Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import sklearn
|
2 |
import gradio as gr
|
3 |
import joblib
|
|
|
4 |
import requests.exceptions
|
5 |
from huggingface_hub import HfApi, hf_hub_download
|
6 |
from huggingface_hub.repocard import metadata_load
|
@@ -9,11 +10,12 @@ from huggingface_hub.repocard import metadata_load
|
|
9 |
#inputs = [gr.Textbox(value = "The customer service was satisfactory.")]
|
10 |
#outputs = [gr.Label(label = "Sentiment")]
|
11 |
#title = "Sentiment Analysis"
|
|
|
12 |
app = gr.Blocks()
|
13 |
|
14 |
def load_agent(model_id_1, model_id_2):
|
15 |
"""
|
16 |
-
This function load the agent's
|
17 |
:return: video_path
|
18 |
"""
|
19 |
# Load the metrics
|
@@ -63,6 +65,13 @@ with app:
|
|
63 |
with gr.Row():
|
64 |
model1_input = gr.Textbox(label="Model 1")
|
65 |
model2_input = gr.Textbox(label="Model 2")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
66 |
with gr.Row():
|
67 |
app_button = gr.Button("Compare models")
|
68 |
with gr.Row():
|
|
|
1 |
import sklearn
|
2 |
import gradio as gr
|
3 |
import joblib
|
4 |
+
from transformers import pipeline
|
5 |
import requests.exceptions
|
6 |
from huggingface_hub import HfApi, hf_hub_download
|
7 |
from huggingface_hub.repocard import metadata_load
|
|
|
10 |
#inputs = [gr.Textbox(value = "The customer service was satisfactory.")]
|
11 |
#outputs = [gr.Label(label = "Sentiment")]
|
12 |
#title = "Sentiment Analysis"
|
13 |
+
|
14 |
app = gr.Blocks()
|
15 |
|
16 |
def load_agent(model_id_1, model_id_2):
|
17 |
"""
|
18 |
+
This function load the agent's results
|
19 |
:return: video_path
|
20 |
"""
|
21 |
# Load the metrics
|
|
|
65 |
with gr.Row():
|
66 |
model1_input = gr.Textbox(label="Model 1")
|
67 |
model2_input = gr.Textbox(label="Model 2")
|
68 |
+
|
69 |
+
with gr.Row():
|
70 |
+
inp = gr.Textbox(placeholder="The customer service was satisfactory.")
|
71 |
+
out = gr.Textbox()
|
72 |
+
btn = gr.Button("Run")
|
73 |
+
btn.click(fn=update, inputs=inp, outputs=out)
|
74 |
+
|
75 |
with gr.Row():
|
76 |
app_button = gr.Button("Compare models")
|
77 |
with gr.Row():
|