Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,16 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
-
|
|
|
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()
|