Spaces:
Running
Running
Update main.py
Browse files
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 |
-
|
20 |
|
21 |
# Load the fine-tuned model and pass the tokenizer explicitly
|
22 |
multilingual_model = pipeline(
|
23 |
"sentiment-analysis",
|
24 |
-
model=
|
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
|