Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
#gr.Interface.load("models/hipnologo/gpt2-imdb-finetune").launch()
|
2 |
import gradio as gr
|
3 |
-
from gradio import
|
4 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
5 |
|
6 |
def predict_review(text):
|
@@ -27,10 +27,10 @@ def predict_review(text):
|
|
27 |
result_md = f"Sentiment: {sentiment}"
|
28 |
return result_md
|
29 |
|
30 |
-
iface =
|
31 |
fn=predict_review,
|
32 |
-
inputs=inputs.Textbox(lines=7, placeholder="Enter text here..."),
|
33 |
-
outputs=outputs.
|
34 |
title="Sentiment Analysis",
|
35 |
description="This application predicts the sentiment (Positive/Negative) of the input text using a fine-tuned GPT-2 model.",
|
36 |
theme="compact" # change this to the theme you prefer: 'huggingface', 'default'
|
|
|
1 |
#gr.Interface.load("models/hipnologo/gpt2-imdb-finetune").launch()
|
2 |
import gradio as gr
|
3 |
+
from gradio import Interface
|
4 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
5 |
|
6 |
def predict_review(text):
|
|
|
27 |
result_md = f"Sentiment: {sentiment}"
|
28 |
return result_md
|
29 |
|
30 |
+
iface = Interface(
|
31 |
fn=predict_review,
|
32 |
+
inputs=gr.inputs.Textbox(lines=7, placeholder="Enter text here..."),
|
33 |
+
outputs=gr.outputs.Textbox(),
|
34 |
title="Sentiment Analysis",
|
35 |
description="This application predicts the sentiment (Positive/Negative) of the input text using a fine-tuned GPT-2 model.",
|
36 |
theme="compact" # change this to the theme you prefer: 'huggingface', 'default'
|