👍️[Update] Models : change print log to json format log

This commit is contained in:
misyaguziya
2024-08-11 13:51:48 +09:00
parent 3924b2eb3b
commit 633cdf246c
4 changed files with 10 additions and 7 deletions

View File

@@ -40,7 +40,8 @@ def downloadFile(url, path, func=None):
func(total_chunk/file_size)
except Exception as e:
print("error:downloadFile()", e)
import json
print(json.dumps({"status":348, "log": f"error:downloadFile() {e}"}), flush=True)
def checkWhisperWeight(root, weight_type):
path = os_path.join(root, "weights", "whisper", weight_type)
@@ -67,7 +68,6 @@ def downloadWhisperWeight(root, weight_type, callbackFunc):
return
for filename in _FILENAMES:
print("Downloading", filename, "...")
file_path = os_path.join(path, filename)
url = huggingface_hub.hf_hub_url(_MODELS[weight_type], filename)
downloadFile(url, file_path, func=callbackFunc)