Update app.py
Browse files
app.py
CHANGED
@@ -85,7 +85,69 @@ def init_leaderboard(dataframe):
|
|
85 |
return f"Points: {user_data[user_id]['points']}\nReferrals: {len(user_data[user_id]['referrals'])}"
|
86 |
else:
|
87 |
return "User not found"
|
88 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
89 |
claim_image = gr.Image(value="path/to/your/claim_image.png", interactive=True, elem_id="claim_image")
|
90 |
start_button.click(fn=display_user_data, inputs=[gr.inputs.Textbox(label="Enter your Telegram User ID")], outputs=user_data_output)
|
91 |
claim_image.click(fn=lambda: "You have claimed your reward!", outputs=gr.outputs.Textbox(label="Message"))
|
|
|
85 |
return f"Points: {user_data[user_id]['points']}\nReferrals: {len(user_data[user_id]['referrals'])}"
|
86 |
else:
|
87 |
return "User not found"
|
88 |
+
import gradio as gr
|
89 |
+
from apscheduler.schedulers.background import BackgroundScheduler
|
90 |
+
# ... (Other imports)
|
91 |
+
|
92 |
+
# ... (Your existing code for ModelType, Precision, WeightType, etc.)
|
93 |
+
|
94 |
+
revision_name_textbox = gr.Textbox(label="Revision commit", placeholder="main")
|
95 |
+
model_type = gr.Dropdown(
|
96 |
+
choices=[t.to_str(" : ") for t in ModelType if t != ModelType.Unknown],
|
97 |
+
label="Model type",
|
98 |
+
multiselect=False,
|
99 |
+
value=None,
|
100 |
+
interactive=True,
|
101 |
+
)
|
102 |
+
with gr.Column():
|
103 |
+
precision = gr.Dropdown(
|
104 |
+
choices=[i.value.name for i in Precision if i != Precision.Unknown],
|
105 |
+
label="Precision",
|
106 |
+
multiselect=False,
|
107 |
+
value="float16",
|
108 |
+
interactive=True,
|
109 |
+
)
|
110 |
+
weight_type = gr.Dropdown(
|
111 |
+
choices=[i.value.name for i in WeightType],
|
112 |
+
label="Weights type",
|
113 |
+
multiselect=False,
|
114 |
+
value="Original",
|
115 |
+
interactive=True,
|
116 |
+
)
|
117 |
+
base_model_name_textbox = gr.Textbox(label="Base model (for delta or adapter weights)")
|
118 |
+
model_name_textbox = gr.Textbox(label="Model name") # Add this line
|
119 |
+
|
120 |
+
submit_button = gr.Button("Submit Eval")
|
121 |
+
submission_result = gr.Markdown()
|
122 |
+
|
123 |
+
# Indent the entire `with gr.Row()` section
|
124 |
+
with gr.Row():
|
125 |
+
with gr.Accordion("📙 Citation", open=False):
|
126 |
+
citation_button = gr.Textbox(
|
127 |
+
value=CITATION_BUTTON_TEXT,
|
128 |
+
label=CITATION_BUTTON_LABEL,
|
129 |
+
lines=20,
|
130 |
+
elem_id="citation-button",
|
131 |
+
show_copy_button=True,
|
132 |
+
)
|
133 |
+
|
134 |
+
# ... (Rest of your code)
|
135 |
+
|
136 |
+
submit_button.click(
|
137 |
+
add_new_eval,
|
138 |
+
[
|
139 |
+
model_name_textbox,
|
140 |
+
base_model_name_textbox,
|
141 |
+
revision_name_textbox,
|
142 |
+
precision,
|
143 |
+
weight_type,
|
144 |
+
model_type,
|
145 |
+
],
|
146 |
+
submission_result,
|
147 |
+
)
|
148 |
+
|
149 |
+
# ... (Scheduler)
|
150 |
+
start_button = gr.Button("Start", elem_id="start_button")
|
151 |
claim_image = gr.Image(value="path/to/your/claim_image.png", interactive=True, elem_id="claim_image")
|
152 |
start_button.click(fn=display_user_data, inputs=[gr.inputs.Textbox(label="Enter your Telegram User ID")], outputs=user_data_output)
|
153 |
claim_image.click(fn=lambda: "You have claimed your reward!", outputs=gr.outputs.Textbox(label="Message"))
|