Emirrv commited on
Commit
8526c25
1 Parent(s): 9788361

update: submit file

Browse files
Files changed (1) hide show
  1. src/submission/submit.py +3 -30
src/submission/submit.py CHANGED
@@ -1,11 +1,11 @@
1
  import json
2
  import os
3
  from datetime import datetime, timezone
4
- import gradio as gr
5
 
6
  from src.display.formatting import styled_error, styled_message
7
  from src.envs import API, EVAL_REQUESTS_PATH, QUEUE_REPO
8
 
 
9
  def add_new_eval(model: str, weight_type: str, gguf_filename=None):
10
  user_name = ""
11
  model_path = model
@@ -21,8 +21,8 @@ def add_new_eval(model: str, weight_type: str, gguf_filename=None):
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
@@ -59,30 +59,3 @@ def add_new_eval(model: str, weight_type: str, gguf_filename=None):
59
  return styled_message(
60
  "Your request has been submitted to the evaluation queue!\nPlease wait for up to five minutes for the model to show in the PENDING list."
61
  )
62
-
63
- def update_gguf_input(weight_type):
64
- return gr.update(interactive=weight_type != "safetensors")
65
-
66
-
67
- with gr.Blocks() as app:
68
- model_input = gr.Textbox(label="Model")
69
- weight_type_input = gr.Dropdown(
70
- label="Weight Type",
71
- choices=["default", "safetensors", "other"],
72
- value="default",
73
- interactive=True
74
- )
75
- gguf_filename_input = gr.Textbox(label="GGUF Filename", interactive=True)
76
- submit_btn = gr.Button("Submit")
77
- output = gr.Markdown()
78
-
79
- # Update gguf_filename input based on weight_type selection
80
- weight_type_input.change(fn=update_gguf_input, inputs=weight_type_input, outputs=gguf_filename_input)
81
-
82
- submit_btn.click(
83
- fn=add_new_eval,
84
- inputs=[model_input, weight_type_input, gguf_filename_input],
85
- outputs=output
86
- )
87
-
88
- # app.launch()
 
1
  import json
2
  import os
3
  from datetime import datetime, timezone
 
4
 
5
  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, weight_type: str, gguf_filename=None):
10
  user_name = ""
11
  model_path = model
 
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
 
59
  return styled_message(
60
  "Your request has been submitted to the evaluation queue!\nPlease wait for up to five minutes for the model to show in the PENDING list."
61
  )