Closed Hongxing2020 closed 5 months ago
Hi @Hongxing2020! I have checked and the following code snippet works for me. It's worth noting that I first ran this with an internet connection so that the model was saved in the Transformers cache directory. After that you should be able to use the model in offline mode.
import os
from momentfm import MOMENTPipeline
os.environ["TRANSFORMERS_OFFLINE"] = "1"
model = MOMENTPipeline.from_pretrained(
"AutonLab/MOMENT-1-large",
model_kwargs={'task_name': 'embedding'},
)
Hi @Hongxing2020, Were you able to resolve the issue? If yes, could you please close the issue? If not, please let us know how we can help you debug!
Hello, Thank you very much for disseminating openly your work and code.
I downloaded the weight file and T5 file from GitHub and HuggingFace respectively. Why do these files always report errors when reading offline?
os.environ['TRANSFORMERS_OFFLINE'] = '1' Model=MOMENTPipeline.free_pretrained( Pretrained_model-name_or_path="D:/git/repo_id/MOMENT-1-large", Cache_dir='D:/git/repo_id/MOMENT-1-large/hook/plan t5 large ', Local_files_only=True, Model_kwargs={"taskname": "reconstruction"}
OSError: We could not connect to ' https://huggingface.co To load this file, could not find it in the cached files and it looks like Google/plan t5 large is not the path to a directory containing a file named config.json Checkout your internet connection or see how to run the library in offline mode at ' https://huggingface.co/docs/transformers/installation#offline -Mode