support local model config file

This commit is contained in:
zhangsibo1129 2023-09-26 10:50:24 +08:00
parent c5de7cd886
commit 5f76dae04a

View File

@ -179,6 +179,9 @@ def download_weights(
import json import json
if is_local_model:
config_filename = os.path.join(model_id, "config.json")
else:
config_filename = hf_hub_download(model_id, revision=revision, filename="config.json") config_filename = hf_hub_download(model_id, revision=revision, filename="config.json")
with open(config_filename, "r") as f: with open(config_filename, "r") as f:
config = json.load(f) config = json.load(f)