Neel2601 commited on
Commit
cae6b78
·
verified ·
1 Parent(s): 8fd7170

Upload api_complete.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. api_complete.py +4 -7
api_complete.py CHANGED
@@ -771,15 +771,12 @@ async def load_all_models():
771
 
772
  # Load Translation Model
773
  try:
774
- nllb_path = base_path / "models" / "translation" / "nllb_600m"
775
- logger.info(f"Loading NLLB translation model from: {nllb_path}")
776
-
777
- if not nllb_path.exists():
778
- raise FileNotFoundError(f"NLLB model path does not exist: {nllb_path}")
779
 
780
  # Use non-fast tokenizer to ensure lang_code_to_id is available
781
- nllb_tokenizer = AutoTokenizer.from_pretrained(str(nllb_path), use_fast=False)
782
- nllb_model = AutoModelForSeq2SeqLM.from_pretrained(str(nllb_path))
783
 
784
  nllb_model.to(device)
785
 
 
771
 
772
  # Load Translation Model
773
  try:
774
+ nllb_model_id = "facebook/nllb-200-distilled-600M"
775
+ logger.info(f"Loading NLLB translation model from HF Hub: {nllb_model_id}")
 
 
 
776
 
777
  # Use non-fast tokenizer to ensure lang_code_to_id is available
778
+ nllb_tokenizer = AutoTokenizer.from_pretrained(nllb_model_id, use_fast=False)
779
+ nllb_model = AutoModelForSeq2SeqLM.from_pretrained(nllb_model_id)
780
 
781
  nllb_model.to(device)
782