Spaces:
Sleeping
Sleeping
manue
commited on
Commit
·
d4b1c2b
1
Parent(s):
e1379c5
Fix model path in sentiment initialization to use local files
Browse files
model/sentiment.py
CHANGED
@@ -3,8 +3,8 @@ from typing import Any
|
|
3 |
|
4 |
class Sentiment:
|
5 |
def __init__(self, line: str) -> (list | list[Any] | Any | None):
|
6 |
-
model = AutoModelForSequenceClassification.from_pretrained("
|
7 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
8 |
|
9 |
self.pipe = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
10 |
self.result = self.pipe(line)
|
|
|
3 |
|
4 |
class Sentiment:
|
5 |
def __init__(self, line: str) -> (list | list[Any] | Any | None):
|
6 |
+
model = AutoModelForSequenceClassification.from_pretrained("models/feel-it-italian-sentiment", local_files_only=True)
|
7 |
+
tokenizer = AutoTokenizer.from_pretrained("models/feel-it-italian-sentiment", local_files_only=True)
|
8 |
|
9 |
self.pipe = pipeline("text-classification", model=model, tokenizer=tokenizer)
|
10 |
self.result = self.pipe(line)
|
{model → models}/feel-it-italian-sentiment
RENAMED
File without changes
|