li commited on
Commit ·
52c562e
1
Parent(s): 5314e8c
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,19 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
examples = [["Two women are observing something together.", "Two women are standing with their eyes closed."],
|
| 4 |
+
["A smiling costumed woman is holding an umbrella", "A happy woman in a fairy costume holds an umbrella"],
|
| 5 |
+
["A soccer game with multiple males playing", "Some men are playing a sport"],
|
| 6 |
+
]
|
| 7 |
+
|
| 8 |
+
gr.Interface(
|
| 9 |
+
fn=predict,
|
| 10 |
+
title="basic with GPT",
|
| 11 |
+
description = "Natural Language Inference by fine-tuning GPT model",
|
| 12 |
+
inputs=["text", "text"],
|
| 13 |
+
examples=examples,
|
| 14 |
+
#outputs=gr.Textbox(label='Prediction'),
|
| 15 |
+
outputs=gr.outputs.Label(num_top_classes=3, label='Semantic similarity'),
|
| 16 |
+
cache_examples=True
|
| 17 |
+
).launch(debug=True, enable_queue=True)
|
| 18 |
+
|
| 19 |
+
# gr.Interface.load("models/openai-gpt").launch()
|