hipnologo commited on
Commit
c5ed07f
·
1 Parent(s): ce9a470

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
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 inputs, outputs
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 = gr.Interface(
31
  fn=predict_review,
32
- inputs=inputs.Textbox(lines=7, placeholder="Enter text here..."),
33
- outputs=outputs.Text(),
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'