Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Commit
·
f6f28fc
1
Parent(s):
cb1120c
Enhance model information retrieval: include number of downloads and likes in the fetch_model_information function and update UI elements accordingly.
Browse files
utils.py
CHANGED
@@ -36,13 +36,13 @@ def get_model_info(model_id, verbose=False):
|
|
36 |
|
37 |
def fetch_model_information(model_name):
|
38 |
try:
|
39 |
-
|
40 |
if len(supported_precisions) == 0:
|
41 |
supported_precisions = [None]
|
42 |
except Exception as e:
|
43 |
gr.Error(f"Error: Could not fetch model information. {str(e)}")
|
44 |
return
|
45 |
-
return gr.update(choices=supported_precisions, value=supported_precisions[0]), num_parameters,
|
46 |
|
47 |
def submit_model(model_name, revision, precision, params, license, task):
|
48 |
# Load existing evaluations
|
@@ -214,12 +214,20 @@ def submit_gradio_module(task_type):
|
|
214 |
with gr.Row():
|
215 |
params_input = gr.Textbox(
|
216 |
label="Params (in Millions)",
|
217 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
218 |
)
|
219 |
|
220 |
submit_button = gr.Button("Submit Model", variant="primary")
|
221 |
submission_result = gr.Markdown()
|
222 |
-
fetch_outputs = [precision_input, params_input,
|
223 |
|
224 |
fetch_data_button.click(
|
225 |
fetch_model_information,
|
|
|
36 |
|
37 |
def fetch_model_information(model_name):
|
38 |
try:
|
39 |
+
num_downloads, num_likes, license, num_parameters, supported_precisions = get_model_info(model_name)
|
40 |
if len(supported_precisions) == 0:
|
41 |
supported_precisions = [None]
|
42 |
except Exception as e:
|
43 |
gr.Error(f"Error: Could not fetch model information. {str(e)}")
|
44 |
return
|
45 |
+
return gr.update(choices=supported_precisions, value=supported_precisions[0]), license, num_parameters, num_downloads, num_likes
|
46 |
|
47 |
def submit_model(model_name, revision, precision, params, license, task):
|
48 |
# Load existing evaluations
|
|
|
214 |
with gr.Row():
|
215 |
params_input = gr.Textbox(
|
216 |
label="Params (in Millions)",
|
217 |
+
interactive=False,
|
218 |
+
)
|
219 |
+
num_downloads_input = gr.Textbox(
|
220 |
+
label="Number of Downloads",
|
221 |
+
interactive=False,
|
222 |
+
)
|
223 |
+
num_likes_input = gr.Textbox(
|
224 |
+
label="Number of Likes",
|
225 |
+
interactive=False,
|
226 |
)
|
227 |
|
228 |
submit_button = gr.Button("Submit Model", variant="primary")
|
229 |
submission_result = gr.Markdown()
|
230 |
+
fetch_outputs = [precision_input, license_input, params_input, num_downloads_input, num_likes_input]
|
231 |
|
232 |
fetch_data_button.click(
|
233 |
fetch_model_information,
|