Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,7 +17,7 @@ def load_agent(model_id_1, model_id_2):
|
|
| 17 |
results_1 = parse_metrics_accuracy(metadata_1)
|
| 18 |
|
| 19 |
# Load the video
|
| 20 |
-
video_path_1 = hf_hub_download(model_id_1, filename="replay.mp4")
|
| 21 |
|
| 22 |
# Load the metrics
|
| 23 |
metadata_2 = get_metadata(model_id_2)
|
|
@@ -26,9 +26,9 @@ def load_agent(model_id_1, model_id_2):
|
|
| 26 |
results_2 = parse_metrics_accuracy(metadata_2)
|
| 27 |
|
| 28 |
# Load the video
|
| 29 |
-
video_path_2 = hf_hub_download(model_id_2, filename="replay.mp4")
|
| 30 |
|
| 31 |
-
return model_id_1
|
| 32 |
|
| 33 |
def parse_metrics_accuracy(meta):
|
| 34 |
if "model-index" not in meta:
|
|
@@ -58,7 +58,7 @@ def get_metadata(model_id):
|
|
| 58 |
with app:
|
| 59 |
gr.Markdown(
|
| 60 |
"""
|
| 61 |
-
# Compare
|
| 62 |
|
| 63 |
Type two models id you want to compare or check examples below.
|
| 64 |
""")
|
|
@@ -70,19 +70,17 @@ with app:
|
|
| 70 |
with gr.Row():
|
| 71 |
with gr.Column():
|
| 72 |
model1_name = gr.Markdown()
|
| 73 |
-
model1_video_output = gr.Video()
|
| 74 |
model1_score_output = gr.Textbox(label="Mean Reward +/- Std Reward")
|
| 75 |
with gr.Column():
|
| 76 |
model2_name = gr.Markdown()
|
| 77 |
-
model2_video_output = gr.Video()
|
| 78 |
model2_score_output = gr.Textbox(label="Mean Reward +/- Std Reward")
|
| 79 |
|
| 80 |
-
app_button.click(load_agent, inputs=[model1_input, model2_input], outputs=[model1_name,
|
| 81 |
|
| 82 |
-
examples = gr.Examples(examples=[["
|
| 83 |
-
["
|
| 84 |
-
["sb3/dqn-SpaceInvadersNoFrameskip-v4", "sb3/a2c-SpaceInvadersNoFrameskip-v4"],
|
| 85 |
-
["ThomasSimonini/ppo-QbertNoFrameskip-v4","sb3/ppo-QbertNoFrameskip-v4"]],
|
| 86 |
inputs=[model1_input, model2_input])
|
| 87 |
|
| 88 |
|
|
|
|
| 17 |
results_1 = parse_metrics_accuracy(metadata_1)
|
| 18 |
|
| 19 |
# Load the video
|
| 20 |
+
#video_path_1 = hf_hub_download(model_id_1, filename="replay.mp4")
|
| 21 |
|
| 22 |
# Load the metrics
|
| 23 |
metadata_2 = get_metadata(model_id_2)
|
|
|
|
| 26 |
results_2 = parse_metrics_accuracy(metadata_2)
|
| 27 |
|
| 28 |
# Load the video
|
| 29 |
+
#video_path_2 = hf_hub_download(model_id_2, filename="replay.mp4")
|
| 30 |
|
| 31 |
+
return model_id_1 results_1, model_id_2, results_2
|
| 32 |
|
| 33 |
def parse_metrics_accuracy(meta):
|
| 34 |
if "model-index" not in meta:
|
|
|
|
| 58 |
with app:
|
| 59 |
gr.Markdown(
|
| 60 |
"""
|
| 61 |
+
# Compare Sentiment Analysis Models
|
| 62 |
|
| 63 |
Type two models id you want to compare or check examples below.
|
| 64 |
""")
|
|
|
|
| 70 |
with gr.Row():
|
| 71 |
with gr.Column():
|
| 72 |
model1_name = gr.Markdown()
|
| 73 |
+
#model1_video_output = gr.Video()
|
| 74 |
model1_score_output = gr.Textbox(label="Mean Reward +/- Std Reward")
|
| 75 |
with gr.Column():
|
| 76 |
model2_name = gr.Markdown()
|
| 77 |
+
#model2_video_output = gr.Video()
|
| 78 |
model2_score_output = gr.Textbox(label="Mean Reward +/- Std Reward")
|
| 79 |
|
| 80 |
+
app_button.click(load_agent, inputs=[model1_input, model2_input], outputs=[model1_name, model1_score_output, model2_name, model2_score_output])
|
| 81 |
|
| 82 |
+
examples = gr.Examples(examples=[["scikit-learn/sentiment-analysis","microsoft/Multilingual-MiniLM-L12-H384"],
|
| 83 |
+
["distilbert-base-uncased-finetuned-sst-2-english", "microsoft/Multilingual-MiniLM-L12-H384"],
|
|
|
|
|
|
|
| 84 |
inputs=[model1_input, model2_input])
|
| 85 |
|
| 86 |
|