moment-timeseries-foundation-model / moment

MOMENT: A Family of Open Time-series Foundation Models
https://moment-timeseries-foundation-model.github.io/
MIT License
365 stars 59 forks source link

offline:t5 large is not the path to a directory #12

Closed Hongxing2020 closed 5 months ago

Hongxing2020 commented 5 months ago

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

KonradSzafer commented 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'}, 
)
mononitogoswami commented 5 months ago

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!