Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError: Couldn't find a module script at /home/tooko/transformers-course/glue/glue.py. #651

Open
AmanoTooko7 opened this issue Dec 7, 2024 · 0 comments

Comments

@AmanoTooko7
Copy link

i run the example of hugging face NLP course(https://huggingface.co/learn/nlp-course/chapter3/4?fw=pt#the-training-loop)
my env at Vmware-ubuntu -vscode,evaluate Version is 0.4.3 . i always encounter this error:

import evaluate
metric = evaluate.load("glue", "mrpc") #此句依旧是出现FileNotFoundError错误
model.eval()

for epoch in range(num_epochs):
for batch in train_dataloader:
batch = {k: v.to(device) for k, v in batch.items()} #将batch中的数据转移到device上,batch是一个字典
with torch.no_grad():
outputs = model(**batch)

logits = outputs.logits
predictions = torch.argmax(logits, dim=-1)
metric.add_batch(predictions=predictions, references=batch["labels"])

FileNotFoundError Traceback (most recent call last)
Cell In[1], line 3
1 import evaluate
----> 3 metric = evaluate.load("glue", "mrpc")
4 model.eval()
6 for epoch in range(num_epochs):

File ~/transformers-course/.env/lib/python3.11/site-packages/evaluate/loading.py:748, in load(path, config_name, module_type, process_id, num_process, cache_dir, experiment_id, keep_in_memory, download_config, download_mode, revision, **init_kwargs)
703 """Load a [~evaluate.EvaluationModule].
704
705 Args:
(...)
745 ```
746 """
747 download_mode = DownloadMode(download_mode or DownloadMode.REUSE_DATASET_IF_EXISTS)
--> 748 evaluation_module = evaluation_module_factory(
749 path, module_type=module_type, revision=revision, download_config=download_config, download_mode=download_mode
750 )
751 evaluation_cls = import_main_class(evaluation_module.module_path)
752 evaluation_instance = evaluation_cls(
753 config_name=config_name,
754 process_id=process_id,
(...)
760 **init_kwargs,
...
684 ) from None
685 else:
686 raise FileNotFoundError(f"Couldn't find a module script at {relative_to_absolute_path(combined_path)}.")

FileNotFoundError: Couldn't find a module script at /home/tooko/transformers-course/glue/glue.py. Module 'glue' doesn't exist on the Hugging Face Hub either.

others opinion to solve this issue is to loging in hugging face account and not use proxy. B cos i am in China so i must use vpn to log in HF but after logged in no matter i used vpn or not the error was existing ,and i try to download glue/glue.py from Colab'example of HF provided but i didn't found. think you for your some advice for this problem (sorry for my bad english)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant