Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,15 @@
|
|
1 |
import streamlit as st
|
2 |
-
import transformers
|
3 |
-
import torch
|
4 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
5 |
|
6 |
-
# Define the
|
7 |
-
|
8 |
-
|
9 |
|
10 |
# Initialize the tokenizer and models for sentiment analysis
|
11 |
-
tokenizer1 = AutoTokenizer.from_pretrained(
|
12 |
-
model1 = AutoModelForSequenceClassification.from_pretrained(
|
13 |
-
tokenizer2 = AutoTokenizer.from_pretrained(
|
14 |
-
model2 = AutoModelForSequenceClassification.from_pretrained(
|
15 |
|
16 |
# Define a function to preprocess the text data
|
17 |
def preprocess(text):
|
|
|
1 |
import streamlit as st
|
|
|
|
|
2 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
3 |
|
4 |
+
# Define the model names or identifiers
|
5 |
+
model1_name = "saisi/finetuned-Sentiment-classfication-ROBERTA-model"
|
6 |
+
model2_name = "saisi/finetuned-Sentiment-classfication-DISTILBERT-model"
|
7 |
|
8 |
# Initialize the tokenizer and models for sentiment analysis
|
9 |
+
tokenizer1 = AutoTokenizer.from_pretrained(model1_name)
|
10 |
+
model1 = AutoModelForSequenceClassification.from_pretrained(model1_name)
|
11 |
+
tokenizer2 = AutoTokenizer.from_pretrained(model2_name)
|
12 |
+
model2 = AutoModelForSequenceClassification.from_pretrained(model2_name)
|
13 |
|
14 |
# Define a function to preprocess the text data
|
15 |
def preprocess(text):
|