Skip to content

Commit

Permalink
feat: enable resume download for hf_hub_download
Browse files Browse the repository at this point in the history
  • Loading branch information
lonelam committed Nov 16, 2023
1 parent 03d1ae6 commit 2009e3f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions private_gpt/settings/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ class LocalSettings(BaseModel):
llm_hf_repo_id: str
llm_hf_model_file: str
embedding_hf_model_name: str
llm_hf_resume_download: bool = Field(
default=True,
description="If `false`, the model downloading progress will always be restarted from the beginning again"
"and leave the previous downloaded tmp file untouched."
)


class SagemakerSettings(BaseModel):
Expand Down
1 change: 1 addition & 0 deletions scripts/setup
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ hf_hub_download(
filename=settings().local.llm_hf_model_file,
cache_dir=models_cache_path,
local_dir=models_path,
resume_download=settings().local.llm_hf_resume_download,
)

print("LLM model downloaded!")
Expand Down

0 comments on commit 2009e3f

Please sign in to comment.