mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-10 20:04:52 +00:00
retry
This commit is contained in:
parent
bc2b9b20e2
commit
1bb1a344d7
@ -40,15 +40,14 @@ def cleanup_cache(token: str):
|
|||||||
size_per_model = {}
|
size_per_model = {}
|
||||||
extension_per_model = {}
|
extension_per_model = {}
|
||||||
for model_id, revision in REQUIRED_MODELS.items():
|
for model_id, revision in REQUIRED_MODELS.items():
|
||||||
|
print(f"Crawling {model_id}...")
|
||||||
model_size = 0
|
model_size = 0
|
||||||
print(f"call huggingface_hub.list_repo_files for {model_id}")
|
|
||||||
all_files = huggingface_hub.list_repo_files(
|
all_files = huggingface_hub.list_repo_files(
|
||||||
model_id,
|
model_id,
|
||||||
repo_type="model",
|
repo_type="model",
|
||||||
revision=revision,
|
revision=revision,
|
||||||
token=token,
|
token=token,
|
||||||
)
|
)
|
||||||
print(f"end huggingface_hub.list_repo_files")
|
|
||||||
|
|
||||||
extension = None
|
extension = None
|
||||||
if any(".safetensors" in filename for filename in all_files):
|
if any(".safetensors" in filename for filename in all_files):
|
||||||
@ -60,9 +59,6 @@ def cleanup_cache(token: str):
|
|||||||
|
|
||||||
extension_per_model[model_id] = extension
|
extension_per_model[model_id] = extension
|
||||||
|
|
||||||
print(
|
|
||||||
f"call huggingface_hub.hf_hub_url & huggingface_hub.get_hf_file_metadata for {model_id}"
|
|
||||||
)
|
|
||||||
for filename in all_files:
|
for filename in all_files:
|
||||||
if filename.endswith(extension):
|
if filename.endswith(extension):
|
||||||
file_url = huggingface_hub.hf_hub_url(
|
file_url = huggingface_hub.hf_hub_url(
|
||||||
@ -72,7 +68,6 @@ def cleanup_cache(token: str):
|
|||||||
file_url, token=token
|
file_url, token=token
|
||||||
)
|
)
|
||||||
model_size += file_metadata.size * 1e-9 # in GB
|
model_size += file_metadata.size * 1e-9 # in GB
|
||||||
print(f"end two calls")
|
|
||||||
|
|
||||||
size_per_model[model_id] = model_size
|
size_per_model[model_id] = model_size
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user