distily
1.0.0
pip install -U "git+https://github.com/lapp0/distily.git"
원격으로 모델을 증류 할 수 있습니다
최소 예 : distily_gpt2
6 개의 층만이있는 증류 gpt2 생성하도록 명령 :
python3 -m distily.run
--teacher_model_name_or_path gpt2
--output_dir distily_gpt2
--hub_model_id "distily/distily_gpt2"
--push_to_hub True
--student_model_config {"n_layers": 6}
--student_model_as_bitnet True
결과적으로 distily_gpt2 모델에는 (Todo : 설명 메트릭)이 있습니다.
더 많은 예를 보려면 예제 문서를 검토하십시오.
허브로 밀려면 허브 토큰을 준비해야합니다.
HF_WRITE=<your hub token> python3 -c "from huggingface_hub.hf_api import HfFolder; HfFolder.save_token('${HF_WRITE}')"
TODO : 링크 된 문서를 완료 한 번 커밋하십시오
Distily 사용
사용 가능한 모델
기여
num_hidden_layers 적은 모델로 증류하십시오. intermediate_size , hidden_act )이있는 모델로 증류하십시오. num_attention_heads 및 num_key_value_heads 가있는 모델로 증류하십시오.