You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FileNotFoundError: [Errno 2] No such file or directory: '/root/.ts_cache/b91f996d8ec980e293ffd169408e9f99b9728f4024744405bef1f2f04ecaedd5/download.cached'
#15
Open
TongmengXie opened this issue
Sep 9, 2023
· 0 comments
[2023-09-09 22:40:28,224] Loading model from http://dmserv4.cs.illinois.edu/pner0.th (might download from source if not cached).
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (7) Failed to connect to dmserv4.cs.illinois.edu port 80: Connection refused
FileNotFoundError Traceback (most recent call last)
Cell In [6], line 5
3 from lightner import decoder_wrapper
4 # model = decoder_wrapper("http://dmserv4.cs.illinois.edu/pner0.th", configs)
----> 5 model = decoder_wrapper()
6 model.decode(["Ronaldo", "won", "'t", "score", "more", "than", "30", "goals", "for", "Juve", "."])
File /usr/local/lib/python3.9/dist-packages/lightner/commands/decoder.py:174, in decoder_wrapper(model_file_path, configs)
171 pw = wrapper(configs.get("log_path", None))
173 logger.info("Loading model from {} (might download from source if not cached).".format(model_file_path))
--> 174 model_file = wrapper.restore_checkpoint(model_file_path)
176 model_type = model_file['config'].get("model_type", 'char-lstm-crf')
177 logger.info('Preparing the pre-trained {} model.'.format(model_type))
File /usr/local/lib/python3.9/dist-packages/torch/serialization.py:699, in load(f, map_location, pickle_module, **pickle_load_args)
696 if 'encoding' not in pickle_load_args.keys():
697 pickle_load_args['encoding'] = 'utf-8'
--> 699 with _open_file_like(f, 'rb') as opened_file:
700 if _is_zipfile(opened_file):
701 # The zipfile reader is going to advance the current file position.
702 # If we want to actually tail call to torch.jit.load, we need to
703 # reset back to the original position.
704 orig_position = opened_file.tell()
File /usr/local/lib/python3.9/dist-packages/torch/serialization.py:230, in _open_file_like(name_or_buffer, mode)
228 def _open_file_like(name_or_buffer, mode):
229 if _is_path(name_or_buffer):
--> 230 return _open_file(name_or_buffer, mode)
231 else:
232 if 'w' in mode:
FileNotFoundError: [Errno 2] No such file or directory: '/root/.ts_cache/b91f996d8ec980e293ffd169408e9f99b9728f4024744405bef1f2f04ecaedd5/download.cached'
The text was updated successfully, but these errors were encountered:
code:
`!pip install lightner
from lightner import decoder_wrapper
model = decoder_wrapper("http://dmserv4.cs.illinois.edu/pner0.th", configs)
model = decoder_wrapper()
model.decode(["Ronaldo", "won", "'t", "score", "more", "than", "30", "goals", "for", "Juve", "."])`
[2023-09-09 22:40:28,224] Loading model from http://dmserv4.cs.illinois.edu/pner0.th (might download from source if not cached).
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (7) Failed to connect to dmserv4.cs.illinois.edu port 80: Connection refused
FileNotFoundError Traceback (most recent call last)
Cell In [6], line 5
3 from lightner import decoder_wrapper
4 # model = decoder_wrapper("http://dmserv4.cs.illinois.edu/pner0.th", configs)
----> 5 model = decoder_wrapper()
6 model.decode(["Ronaldo", "won", "'t", "score", "more", "than", "30", "goals", "for", "Juve", "."])
File /usr/local/lib/python3.9/dist-packages/lightner/commands/decoder.py:174, in decoder_wrapper(model_file_path, configs)
171 pw = wrapper(configs.get("log_path", None))
173 logger.info("Loading model from {} (might download from source if not cached).".format(model_file_path))
--> 174 model_file = wrapper.restore_checkpoint(model_file_path)
176 model_type = model_file['config'].get("model_type", 'char-lstm-crf')
177 logger.info('Preparing the pre-trained {} model.'.format(model_type))
File /usr/local/lib/python3.9/dist-packages/torch_scope/wrapper.py:161, in basic_wrapper.restore_checkpoint(file_path)
146 @staticmethod
147 def restore_checkpoint(file_path):
148 """
149 Restore checkpoint.
150
(...)
159 A
dict
contains 'model' and 'optimizer' (if saved).160 """
--> 161 return torch.load(cached_url(file_path), map_location=lambda storage, loc: storage)
File /usr/local/lib/python3.9/dist-packages/torch/serialization.py:699, in load(f, map_location, pickle_module, **pickle_load_args)
696 if 'encoding' not in pickle_load_args.keys():
697 pickle_load_args['encoding'] = 'utf-8'
--> 699 with _open_file_like(f, 'rb') as opened_file:
700 if _is_zipfile(opened_file):
701 # The zipfile reader is going to advance the current file position.
702 # If we want to actually tail call to torch.jit.load, we need to
703 # reset back to the original position.
704 orig_position = opened_file.tell()
File /usr/local/lib/python3.9/dist-packages/torch/serialization.py:230, in _open_file_like(name_or_buffer, mode)
228 def _open_file_like(name_or_buffer, mode):
229 if _is_path(name_or_buffer):
--> 230 return _open_file(name_or_buffer, mode)
231 else:
232 if 'w' in mode:
File /usr/local/lib/python3.9/dist-packages/torch/serialization.py:211, in _open_file.init(self, name, mode)
210 def init(self, name, mode):
--> 211 super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: '/root/.ts_cache/b91f996d8ec980e293ffd169408e9f99b9728f4024744405bef1f2f04ecaedd5/download.cached'
The text was updated successfully, but these errors were encountered: