Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,11 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
-
|
| 3 |
-
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 4 |
|
|
|
|
| 5 |
tokenizer = AutoTokenizer.from_pretrained("OatNapat/finetuned_yelp")
|
| 6 |
model = AutoModelForSequenceClassification.from_pretrained("OatNapat/finetuned_yelp")
|
| 7 |
-
# Use a pipeline as a high-level helper
|
| 8 |
-
from transformers import pipeline
|
| 9 |
|
| 10 |
-
|
|
|
|
| 11 |
|
| 12 |
text = st.text_input('กรุณาถอดรองเท้า')
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
|
|
|
|
| 3 |
|
| 4 |
+
# Load the tokenizer and model
|
| 5 |
tokenizer = AutoTokenizer.from_pretrained("OatNapat/finetuned_yelp")
|
| 6 |
model = AutoModelForSequenceClassification.from_pretrained("OatNapat/finetuned_yelp")
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
# Create a sentiment analysis pipeline with the explicit tokenizer
|
| 9 |
+
nlp = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
|
| 10 |
|
| 11 |
text = st.text_input('กรุณาถอดรองเท้า')
|