Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,15 +2,13 @@ import gradio as gr
|
|
| 2 |
from transformers import pipeline
|
| 3 |
import os
|
| 4 |
|
| 5 |
-
model = pipeline("text-classification", model="i0xs0/
|
|
|
|
| 6 |
|
| 7 |
-
if not os.path.exists(".logs"):
|
| 8 |
-
os.makedirs(".logs")
|
| 9 |
|
| 10 |
def predict_emotion(text):
|
| 11 |
|
| 12 |
-
|
| 13 |
-
log_file.write(f"User input: {text}\n")
|
| 14 |
results = model(text)
|
| 15 |
return {item["label"]: item["score"] for item in results}
|
| 16 |
|
|
|
|
| 2 |
from transformers import pipeline
|
| 3 |
import os
|
| 4 |
|
| 5 |
+
model = pipeline("text-classification", model="i0xs0/Text_Classification_V2", tokenizer="i0xs0/Text_Classification_V2")
|
| 6 |
+
|
| 7 |
|
|
|
|
|
|
|
| 8 |
|
| 9 |
def predict_emotion(text):
|
| 10 |
|
| 11 |
+
|
|
|
|
| 12 |
results = model(text)
|
| 13 |
return {item["label"]: item["score"] for item in results}
|
| 14 |
|