Spaces:
Sleeping
Sleeping
Commit ·
0dbd09c
1
Parent(s): 4b8b5cc
Fix model loading for local files
Browse files16 unmodified lines171819202122232416 unmodified lineslogging.info(f"Loading FLAN-T5 model from local folder ({_MODEL_DIR})...")try:tokenizer = AutoTokenizer.from_pretrained(_MODEL_DIR)model = AutoModelForSeq2SeqLM.from_pretrained(_MODEL_DIR)model.to("cpu") # force CPU to avoid GPU memory issueslogging.info("Model loaded successfully.")except Exception as e:16 unmodified lines171819202122232416 unmodified lineslogging.info(f"Loading FLAN-T5 model from local folder ({_MODEL_DIR})...")try:tokenizer = AutoTokenizer.from_pretrained(_MODEL_DIR, local_files_only=True)model = AutoModelForSeq2SeqLM.from_pretrained(_MODEL_DIR, local_files_only=True)model.to("cpu") # force CPU to avoid GPU memory issueslogging.info("Model loaded successfully.")except Exception as e:
nlp/model.py+2-2