hipnologo commited on
Commit
a967e1a
1 Parent(s): 83d0a05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -1,3 +1,16 @@
1
  import gradio as gr
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- gr.Interface.load("models/hipnologo/gpt2-imdb-finetune").launch()
 
1
  import gradio as gr
2
+ #gr.Interface.load("models/hipnologo/gpt2-imdb-finetune").launch()
3
+ import gradio as gr
4
+
5
+ def postprocess_label(label):
6
+ if label == "LABEL_0":
7
+ return "Negative"
8
+ elif label == "LABEL_1":
9
+ return "Positive"
10
+ else:
11
+ return "Unknown label"
12
+
13
+ iface = gr.Interface.load("models/hipnologo/gpt2-imdb-finetune")
14
+ iface.update(outputs=gr.outputs.Textbox(label="Sentiment", postprocess=postprocess_label))
15
 
16
+ iface.launch()