by Guest » 06 Sep 2025, 15:37
Ich erhalte diesen Fehler immer wieder, wenn ich versuche, die Bibliothek der Face -Transformers zu verwenden. < /p>
Code: Select all
huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': 'C:/Users/FZH91R/PycharmProjects/DudeWheresMyHealing/Pytorch/tf_model.h5'. Use `repo_type` argument if needed.
< /code>
Hier ist mein Code: < /p>
CODE_DIR = os.path.dirname(__file__)
ROOT_DIR = os.path.dirname(CODE_DIR)
MODEL_DIR = os.path.join(ROOT_DIR, "Pytorch")
CONFIG_DIR = os.path.join(ROOT_DIR, "Pytorch")
# Load the model to be used.
path_model = MODEL_DIR + "\tf_model.h5"
print(path_model)
path_config = CONFIG_DIR + "\config.json"
print(path_config)
# Load model from a local source.
tokenizer = AutoTokenizer.from_pretrained(path_model, local_files_only=True)
model = AutoModel.from_pretrained(path_model, config=path_config, local_files_only=True)
Meine Versionen:
Transformers-4.31.0
Wie kann ich diesen Fehler beheben?
[url=viewtopic.php?t=21966]Ich erhalte diesen Fehler immer[/url] wieder, wenn ich versuche, die Bibliothek der Face -Transformers zu verwenden. < /p>
[code]huggingface_hub.utils._validators.HFValidationError: Repo id must be in the form 'repo_name' or 'namespace/repo_name': 'C:/Users/FZH91R/PycharmProjects/DudeWheresMyHealing/Pytorch/tf_model.h5'. Use `repo_type` argument if needed.
< /code>
Hier ist mein Code: < /p>
CODE_DIR = os.path.dirname(__file__)
ROOT_DIR = os.path.dirname(CODE_DIR)
MODEL_DIR = os.path.join(ROOT_DIR, "Pytorch")
CONFIG_DIR = os.path.join(ROOT_DIR, "Pytorch")
# Load the model to be used.
path_model = MODEL_DIR + "\tf_model.h5"
print(path_model)
path_config = CONFIG_DIR + "\config.json"
print(path_config)
# Load model from a local source.
tokenizer = AutoTokenizer.from_pretrained(path_model, local_files_only=True)
model = AutoModel.from_pretrained(path_model, config=path_config, local_files_only=True)
[/code]
Meine Versionen:
Transformers-4.31.0
Wie kann ich diesen Fehler beheben?