pruned-llama2-7b
모델 설명
이 모델은 Progressive Loading을 지원하는 프루닝된 LLaMA 모델입니다.
파일 구조
P.safetensors: 주요 레이어들 (프루닝된 모델의 핵심 부분)R1.safetensors: 복원 레이어 그룹 1R2.safetensors: 복원 레이어 그룹 2manifest.json: 레이어 매핑 정보 및 메타데이터original_config/: 원본 모델 설정 및 토크나이저prune_map.json: 프루닝 맵 정보
사용 방법
Progressive Loading으로 모델 로드
from hf_progressive_loader import HuggingFaceProgressiveLoader
허깅페이스에서 직접 로딩
loader = HuggingFaceProgressiveLoader("rinarina0429/pruned-llama2-7b")
model, tokenizer = loader.progressive_stage_loading("cuda")
추론
inputs = tokenizer("Hello world!", return_tensors="pt")
if torch.cuda.is_available():
inputs = {k: v.to("cuda") for k, v in inputs.items()}
model.eval()
with torch.no_grad():
outputs = model(**inputs)
print(outputs.logits.shape)
text
## 성능
- **전체 로딩 시간**: 15-30초 (GPU 환경)
- **메모리 효율성**: 단계적 로딩으로 메모리 절약
- **캐시 지원**: 두 번째 로딩부터 빠른 속도
## 라이선스
MIT License