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

cannot import name 'Final' from 'typing' #83

Open
lijiabad opened this issue May 6, 2023 · 2 comments
Open

cannot import name 'Final' from 'typing' #83

lijiabad opened this issue May 6, 2023 · 2 comments

Comments

@lijiabad
Copy link

lijiabad commented May 6, 2023

when I run demo.py it showed "ImportError: cannot import name 'Final' from 'typing' (/home/jsj616/miniconda3/envs/vilt/lib/python3.7/typing.py)" my environment is ipython 7.34.0 pypi_0 pypi
python 3.7.16 h7a1cb2a_0 defaults other configuration is same as the document.I cant figure it out

@2223xia
Copy link

2223xia commented May 7, 2023

you can find the 'beit.py' and 'eva.py', using:'from typing_extensions import Final
from typing import Callable, Optional, Tuple, Union' instead of 'from typing import Callable, Final, Optional, Tuple, Union'.
But it still showed "WARNING - ViLT - No observers have been added to this run
INFO - ViLT - Running command 'main'
INFO - ViLT - Started
ERROR - ViLT - Failed after 0:00:10!
Traceback (most recent calls WITHOUT Sacred internals):
File "demo.py", line 36, in main
tokenizer = get_pretrained_tokenizer(_config["tokenizer"])
File "E:\ViLT-master\ViLT-master\vilt\datamodules\datamodule_base.py", line 20, in get_pretrained_tokenizer
from_pretrained, do_lower_case="uncased" in from_pretrained
File "E:\Anaconda\envs\my_vilt\lib\site-packages\transformers\tokenization_utils_base.py", line 1745, in from_pretrained
use_auth_token=use_auth_token,
File "E:\Anaconda\envs\my_vilt\lib\site-packages\transformers\file_utils.py", line 1056, in cached_path
local_files_only=local_files_only,
File "E:\Anaconda\envs\my_vilt\lib\site-packages\transformers\file_utils.py", line 1235, in get_from_cache
"Connection error, and we cannot find the requested files in the cached path."
ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on."

@JackieQiang
Copy link

you can find the 'beit.py' and 'eva.py', using:'from typing_extensions import Final from typing import Callable, Optional, Tuple, Union' instead of 'from typing import Callable, Final, Optional, Tuple, Union'. But it still showed "WARNING - ViLT - No observers have been added to this run INFO - ViLT - Running command 'main' INFO - ViLT - Started ERROR - ViLT - Failed after 0:00:10! Traceback (most recent calls WITHOUT Sacred internals): File "demo.py", line 36, in main tokenizer = get_pretrained_tokenizer(_config["tokenizer"]) File "E:\ViLT-master\ViLT-master\vilt\datamodules\datamodule_base.py", line 20, in get_pretrained_tokenizer from_pretrained, do_lower_case="uncased" in from_pretrained File "E:\Anaconda\envs\my_vilt\lib\site-packages\transformers\tokenization_utils_base.py", line 1745, in from_pretrained use_auth_token=use_auth_token, File "E:\Anaconda\envs\my_vilt\lib\site-packages\transformers\file_utils.py", line 1056, in cached_path local_files_only=local_files_only, File "E:\Anaconda\envs\my_vilt\lib\site-packages\transformers\file_utils.py", line 1235, in get_from_cache "Connection error, and we cannot find the requested files in the cached path." ValueError: Connection error, and we cannot find the requested files in the cached path. Please try again or make sure your Internet connection is on."

same problem

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

3 participants