Spaces:
Runtime error
Runtime error
Commit
•
3853379
1
Parent(s):
4d35460
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,4 @@
|
|
1 |
-
|
2 |
-
device = 'cpu'
|
3 |
-
MODEL_PATH = "finiteautomata/bertweet-base-sentiment-analysis"
|
4 |
-
tokenizer = AutoTokenizer.from_pretrained(MODEL_PATH)
|
5 |
-
model = AutoModelForSequenceClassification.from_pretrained(MODEL_PATH)
|
6 |
-
model = model.to(device)
|
7 |
def get_predictions(input_text: str) -> dict:
|
8 |
label2id = model.config.label2id
|
9 |
inputs = tokenizer(input_text, return_tensors='pt', truncation=True)
|
|
|
1 |
+
|
|
|
|
|
|
|
|
|
|
|
2 |
def get_predictions(input_text: str) -> dict:
|
3 |
label2id = model.config.label2id
|
4 |
inputs = tokenizer(input_text, return_tensors='pt', truncation=True)
|