Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,8 +12,8 @@ def main():
|
|
| 12 |
# Load sentiment analysis pipeline only once using st.session_state
|
| 13 |
if 'sentiment_analyzer' not in st.session_state:
|
| 14 |
# Load your custom sentiment analysis model
|
| 15 |
-
model = AutoModelForSequenceClassification.from_pretrained("
|
| 16 |
-
tokenizer = AutoTokenizer.from_pretrained("
|
| 17 |
st.session_state.sentiment_analyzer = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
|
| 18 |
|
| 19 |
# Load summarization pipeline only once using st.session_state
|
|
|
|
| 12 |
# Load sentiment analysis pipeline only once using st.session_state
|
| 13 |
if 'sentiment_analyzer' not in st.session_state:
|
| 14 |
# Load your custom sentiment analysis model
|
| 15 |
+
model = AutoModelForSequenceClassification.from_pretrained("WRX020510/CustomModel_twitter", num_labels=3)
|
| 16 |
+
tokenizer = AutoTokenizer.from_pretrained("cardiffnlp/twitter-roberta-base-sentiment-latest")
|
| 17 |
st.session_state.sentiment_analyzer = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
|
| 18 |
|
| 19 |
# Load summarization pipeline only once using st.session_state
|