adding weight_type and gguf_filename
Browse files- app.py +20 -3
- src/submission/submit.py +7 -1
app.py
CHANGED
|
@@ -228,15 +228,32 @@ with demo:
|
|
| 228 |
gr.Markdown("# ✉️✨ Submit your model here!", elem_classes="markdown-text")
|
| 229 |
|
| 230 |
with gr.Row():
|
| 231 |
-
with gr.
|
| 232 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 233 |
|
| 234 |
submit_button = gr.Button("Submit Eval")
|
| 235 |
submission_result = gr.Markdown()
|
| 236 |
submit_button.click(
|
| 237 |
add_new_eval,
|
| 238 |
[
|
| 239 |
-
model_name_textbox
|
|
|
|
|
|
|
| 240 |
],
|
| 241 |
submission_result,
|
| 242 |
)
|
|
|
|
| 228 |
gr.Markdown("# ✉️✨ Submit your model here!", elem_classes="markdown-text")
|
| 229 |
|
| 230 |
with gr.Row():
|
| 231 |
+
with gr.Column():
|
| 232 |
+
with gr.Row():
|
| 233 |
+
model_name_textbox = gr.Textbox(label="Model name")
|
| 234 |
+
|
| 235 |
+
with gr.Column():
|
| 236 |
+
with gr.Row():
|
| 237 |
+
weight_type = gr.Dropdown(
|
| 238 |
+
choices=['safetensors', 'gguf'],
|
| 239 |
+
label="Weights type",
|
| 240 |
+
multiselect=False,
|
| 241 |
+
value='safetensors',
|
| 242 |
+
interactive=True,
|
| 243 |
+
)
|
| 244 |
+
|
| 245 |
+
with gr.Column():
|
| 246 |
+
with gr.Row():
|
| 247 |
+
gguf_filename_textbox = gr.Textbox(label="GGUF filename")
|
| 248 |
|
| 249 |
submit_button = gr.Button("Submit Eval")
|
| 250 |
submission_result = gr.Markdown()
|
| 251 |
submit_button.click(
|
| 252 |
add_new_eval,
|
| 253 |
[
|
| 254 |
+
model_name_textbox,
|
| 255 |
+
weight_type,
|
| 256 |
+
gguf_filename_textbox
|
| 257 |
],
|
| 258 |
submission_result,
|
| 259 |
)
|
src/submission/submit.py
CHANGED
|
@@ -6,7 +6,7 @@ from src.display.formatting import styled_error, styled_message
|
|
| 6 |
from src.envs import API, EVAL_REQUESTS_PATH, QUEUE_REPO
|
| 7 |
|
| 8 |
|
| 9 |
-
def add_new_eval(model: str):
|
| 10 |
user_name = ""
|
| 11 |
model_path = model
|
| 12 |
if "/" in model:
|
|
@@ -20,12 +20,18 @@ def add_new_eval(model: str):
|
|
| 20 |
model_info = API.model_info(repo_id=model, revision='main')
|
| 21 |
except Exception:
|
| 22 |
return styled_error("Could not get your model information.")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# Seems good, creating the eval
|
| 25 |
print("Adding new eval")
|
| 26 |
|
| 27 |
eval_entry = {
|
| 28 |
"model": model,
|
|
|
|
|
|
|
| 29 |
"status": "PENDING",
|
| 30 |
"submitted_time": current_time,
|
| 31 |
}
|
|
|
|
| 6 |
from src.envs import API, EVAL_REQUESTS_PATH, QUEUE_REPO
|
| 7 |
|
| 8 |
|
| 9 |
+
def add_new_eval(model: str, weight_type: str, gguf_filename=None):
|
| 10 |
user_name = ""
|
| 11 |
model_path = model
|
| 12 |
if "/" in model:
|
|
|
|
| 20 |
model_info = API.model_info(repo_id=model, revision='main')
|
| 21 |
except Exception:
|
| 22 |
return styled_error("Could not get your model information.")
|
| 23 |
+
|
| 24 |
+
if weight_type=="safetensors":
|
| 25 |
+
if len(gguf_filename)!=0:
|
| 26 |
+
return styled_error("GGUF filename should be empty when using safetensors.")
|
| 27 |
|
| 28 |
# Seems good, creating the eval
|
| 29 |
print("Adding new eval")
|
| 30 |
|
| 31 |
eval_entry = {
|
| 32 |
"model": model,
|
| 33 |
+
"weight_type": weight_type,
|
| 34 |
+
"gguf_filename": gguf_filename,
|
| 35 |
"status": "PENDING",
|
| 36 |
"submitted_time": current_time,
|
| 37 |
}
|