Ehrii commited on
Commit
04c4b48
·
verified ·
1 Parent(s): 525c61f

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +4 -3
main.py CHANGED
@@ -16,13 +16,14 @@ app = FastAPI()
16
  # Load the original tokenizer from the base model
17
  original_tokenizer = AutoTokenizer.from_pretrained("tabularisai/multilingual-sentiment-analysis")
18
 
19
- model_path = os.path.join(os.path.dirname(__file__), "multimodel")
20
 
21
  # Load the fine-tuned model and pass the tokenizer explicitly
22
  multilingual_model = pipeline(
23
  "sentiment-analysis",
24
- model=model_path,
25
- tokenizer=original_tokenizer
 
26
  )
27
 
28
  # English model remains unchanged
 
16
  # Load the original tokenizer from the base model
17
  original_tokenizer = AutoTokenizer.from_pretrained("tabularisai/multilingual-sentiment-analysis")
18
 
19
+ hf_token = os.getenv("HF_TOKEN")
20
 
21
  # Load the fine-tuned model and pass the tokenizer explicitly
22
  multilingual_model = pipeline(
23
  "sentiment-analysis",
24
+ model="Ehrii/sentiment",
25
+ tokenizer=original_tokenizer,
26
+ token=hf_token
27
  )
28
 
29
  # English model remains unchanged