Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,29 +1,3 @@
|
|
| 1 |
# original:
|
| 2 |
-
#import gradio as gr
|
| 3 |
-
#gr.Interface.load("models/sileod/deberta-v3-base-tasksource-nli").launch()
|
| 4 |
-
|
| 5 |
-
# chatGPT prompt1: Rewrite this program in python and gradio to load an example file with two input text fields and output of the classification field.
|
| 6 |
-
|
| 7 |
import gradio as gr
|
| 8 |
-
|
| 9 |
-
def classify_text(text1, text2):
|
| 10 |
-
# Load pre-trained model
|
| 11 |
-
model = gr.Interface.load("models/sileod/deberta-v3-base-tasksource-nli")
|
| 12 |
-
|
| 13 |
-
# Perform classification on input text
|
| 14 |
-
output = model.predict([text1, text2])[0]
|
| 15 |
-
|
| 16 |
-
return output
|
| 17 |
-
|
| 18 |
-
# Create input fields
|
| 19 |
-
input_text1 = gr.Textbox(label="Input Text 1")
|
| 20 |
-
input_text2 = gr.Textbox(label="Input Text 2")
|
| 21 |
-
|
| 22 |
-
# Create output field
|
| 23 |
-
output_text = gr.Textbox(label="Classification Output")
|
| 24 |
-
|
| 25 |
-
# Create Gradio interface
|
| 26 |
-
gr.Interface(classify_text,
|
| 27 |
-
inputs=[input_text1, input_text2],
|
| 28 |
-
outputs=output_text,
|
| 29 |
-
examples=[["Example Text 1", "Example Text 2"]]).launch()
|
|
|
|
| 1 |
# original:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
+
gr.Interface.load("models/sileod/deberta-v3-base-tasksource-nli").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|