Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -10,13 +10,13 @@ models = {
|
|
10 |
import gradio as gr
|
11 |
|
12 |
def evaluate_model(input_text):
|
13 |
-
return [model(input_text) if model_name != 'devngho/ko_edu_classifier_v2_nlpai-lab_KoE5' else model('passage: ' + input_text) for model_name, model in models.items()]
|
14 |
|
15 |
# Gradio interface
|
16 |
with gr.Blocks() as demo:
|
17 |
-
input_text = gr.Textbox(label="Input Text")
|
18 |
submit_button = gr.Button("Evaluate")
|
19 |
-
output_scores = [gr.Number(f'Score by {name}') for name in models.keys()]
|
20 |
|
21 |
# Action to perform on button click
|
22 |
submit_button.click(evaluate_model, inputs=input_text, outputs=output_scores)
|
|
|
10 |
import gradio as gr
|
11 |
|
12 |
def evaluate_model(input_text):
|
13 |
+
return [model(input_text)[0]['score'] * 6 if model_name != 'devngho/ko_edu_classifier_v2_nlpai-lab_KoE5' else model('passage: ' + input_text)[0]['score'] * 6 for model_name, model in models.items()]
|
14 |
|
15 |
# Gradio interface
|
16 |
with gr.Blocks() as demo:
|
17 |
+
input_text = gr.Textbox(label="Input Text", lines=10)
|
18 |
submit_button = gr.Button("Evaluate")
|
19 |
+
output_scores = [gr.Number(f'Score by {name}', show_label=True) for name in models.keys()]
|
20 |
|
21 |
# Action to perform on button click
|
22 |
submit_button.click(evaluate_model, inputs=input_text, outputs=output_scores)
|