Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
| 1 |
from transformers import pipeline
|
|
|
|
| 2 |
|
| 3 |
def load_svm_model(model_name):
|
| 4 |
# Load the trained SVM model from Hugging Face
|
|
@@ -16,7 +17,6 @@ def predict_sentiment(text):
|
|
| 16 |
confidence = result[0]['score'] * 100
|
| 17 |
return f"{sentiment_label} ({confidence:.2f}%)"
|
| 18 |
|
| 19 |
-
|
| 20 |
# Create Gradio interface
|
| 21 |
iface = gr.Interface(
|
| 22 |
fn=predict_sentiment,
|
|
|
|
| 1 |
from transformers import pipeline
|
| 2 |
+
import gradio as gr
|
| 3 |
|
| 4 |
def load_svm_model(model_name):
|
| 5 |
# Load the trained SVM model from Hugging Face
|
|
|
|
| 17 |
confidence = result[0]['score'] * 100
|
| 18 |
return f"{sentiment_label} ({confidence:.2f}%)"
|
| 19 |
|
|
|
|
| 20 |
# Create Gradio interface
|
| 21 |
iface = gr.Interface(
|
| 22 |
fn=predict_sentiment,
|