Spaces:
Runtime error
Runtime error
Commit
·
5dd610e
1
Parent(s):
198736b
Add emoji
Browse files
app.py
CHANGED
|
@@ -114,7 +114,7 @@ def certification(hf_username):
|
|
| 114 |
"min_result": 200,
|
| 115 |
"best_result": 0,
|
| 116 |
"best_model_id": "",
|
| 117 |
-
"
|
| 118 |
},
|
| 119 |
{
|
| 120 |
"unit": "Unit 2",
|
|
@@ -123,7 +123,7 @@ def certification(hf_username):
|
|
| 123 |
"min_result": 4,
|
| 124 |
"best_result": 0,
|
| 125 |
"best_model_id": "",
|
| 126 |
-
"
|
| 127 |
},
|
| 128 |
{
|
| 129 |
"unit": "Unit 3",
|
|
@@ -132,7 +132,7 @@ def certification(hf_username):
|
|
| 132 |
"min_result": 200,
|
| 133 |
"best_result": 0,
|
| 134 |
"best_model_id": "",
|
| 135 |
-
"
|
| 136 |
},
|
| 137 |
{
|
| 138 |
"unit": "Unit 4",
|
|
@@ -141,7 +141,7 @@ def certification(hf_username):
|
|
| 141 |
"min_result": 350,
|
| 142 |
"best_result": 0,
|
| 143 |
"best_model_id": "",
|
| 144 |
-
"
|
| 145 |
},
|
| 146 |
{
|
| 147 |
"unit": "Unit 4",
|
|
@@ -150,7 +150,7 @@ def certification(hf_username):
|
|
| 150 |
"min_result": 5,
|
| 151 |
"best_result": 0,
|
| 152 |
"best_model_id": "",
|
| 153 |
-
"
|
| 154 |
},
|
| 155 |
{
|
| 156 |
"unit": "Unit 5",
|
|
@@ -159,7 +159,7 @@ def certification(hf_username):
|
|
| 159 |
"min_result": -100,
|
| 160 |
"best_result": 0,
|
| 161 |
"best_model_id": "",
|
| 162 |
-
"
|
| 163 |
},
|
| 164 |
{
|
| 165 |
"unit": "Unit 5",
|
|
@@ -168,7 +168,7 @@ def certification(hf_username):
|
|
| 168 |
"min_result": -100,
|
| 169 |
"best_result": 0,
|
| 170 |
"best_model_id": "",
|
| 171 |
-
"
|
| 172 |
},
|
| 173 |
{
|
| 174 |
"unit": "Unit 6",
|
|
@@ -177,7 +177,7 @@ def certification(hf_username):
|
|
| 177 |
"min_result": 650,
|
| 178 |
"best_result": 0,
|
| 179 |
"best_model_id": "",
|
| 180 |
-
"
|
| 181 |
},
|
| 182 |
{
|
| 183 |
"unit": "Unit 6",
|
|
@@ -186,7 +186,7 @@ def certification(hf_username):
|
|
| 186 |
"min_result": -3.5,
|
| 187 |
"best_result": 0,
|
| 188 |
"best_model_id": "",
|
| 189 |
-
"
|
| 190 |
},
|
| 191 |
{
|
| 192 |
"unit": "Unit 7",
|
|
@@ -195,7 +195,7 @@ def certification(hf_username):
|
|
| 195 |
"min_result": -100,
|
| 196 |
"best_result": 0,
|
| 197 |
"best_model_id": "",
|
| 198 |
-
"
|
| 199 |
},
|
| 200 |
{
|
| 201 |
"unit": "Unit 8 PI",
|
|
@@ -204,7 +204,7 @@ def certification(hf_username):
|
|
| 204 |
"min_result": -100,
|
| 205 |
"best_result": 0,
|
| 206 |
"best_model_id": "",
|
| 207 |
-
"
|
| 208 |
},
|
| 209 |
{
|
| 210 |
"unit": "Unit 8 PII",
|
|
@@ -213,7 +213,7 @@ def certification(hf_username):
|
|
| 213 |
"min_result": -100,
|
| 214 |
"best_result": 0,
|
| 215 |
"best_model_id": "",
|
| 216 |
-
"
|
| 217 |
},
|
| 218 |
]
|
| 219 |
for unit in results_certification:
|
|
@@ -229,7 +229,7 @@ def certification(hf_username):
|
|
| 229 |
|
| 230 |
# Based on best_result do we pass the unit?
|
| 231 |
check_if_passed(unit)
|
| 232 |
-
|
| 233 |
|
| 234 |
print(results_certification)
|
| 235 |
|
|
@@ -256,7 +256,7 @@ with gr.Blocks() as demo:
|
|
| 256 |
hf_username = gr.Textbox(placeholder="ThomasSimonini", label="Your Hugging Face Username")
|
| 257 |
#email = gr.Textbox(placeholder="[email protected]", label="Your Email (to receive your certificate)")
|
| 258 |
check_progress_button = gr.Button(value="Check my progress")
|
| 259 |
-
output = gr.components.Dataframe(value= certification(hf_username), headers=["Pass?", "Unit", "Environment", "Baseline", "Your best result", "Your best model id"], datatype=["
|
| 260 |
check_progress_button.click(fn=certification, inputs=hf_username, outputs=output)
|
| 261 |
|
| 262 |
demo.launch()
|
|
|
|
| 114 |
"min_result": 200,
|
| 115 |
"best_result": 0,
|
| 116 |
"best_model_id": "",
|
| 117 |
+
"passed_": False
|
| 118 |
},
|
| 119 |
{
|
| 120 |
"unit": "Unit 2",
|
|
|
|
| 123 |
"min_result": 4,
|
| 124 |
"best_result": 0,
|
| 125 |
"best_model_id": "",
|
| 126 |
+
"passed_": False
|
| 127 |
},
|
| 128 |
{
|
| 129 |
"unit": "Unit 3",
|
|
|
|
| 132 |
"min_result": 200,
|
| 133 |
"best_result": 0,
|
| 134 |
"best_model_id": "",
|
| 135 |
+
"passed_": False
|
| 136 |
},
|
| 137 |
{
|
| 138 |
"unit": "Unit 4",
|
|
|
|
| 141 |
"min_result": 350,
|
| 142 |
"best_result": 0,
|
| 143 |
"best_model_id": "",
|
| 144 |
+
"passed_": False
|
| 145 |
},
|
| 146 |
{
|
| 147 |
"unit": "Unit 4",
|
|
|
|
| 150 |
"min_result": 5,
|
| 151 |
"best_result": 0,
|
| 152 |
"best_model_id": "",
|
| 153 |
+
"passed_": False
|
| 154 |
},
|
| 155 |
{
|
| 156 |
"unit": "Unit 5",
|
|
|
|
| 159 |
"min_result": -100,
|
| 160 |
"best_result": 0,
|
| 161 |
"best_model_id": "",
|
| 162 |
+
"passed_": False
|
| 163 |
},
|
| 164 |
{
|
| 165 |
"unit": "Unit 5",
|
|
|
|
| 168 |
"min_result": -100,
|
| 169 |
"best_result": 0,
|
| 170 |
"best_model_id": "",
|
| 171 |
+
"passed_": False
|
| 172 |
},
|
| 173 |
{
|
| 174 |
"unit": "Unit 6",
|
|
|
|
| 177 |
"min_result": 650,
|
| 178 |
"best_result": 0,
|
| 179 |
"best_model_id": "",
|
| 180 |
+
"passed_": False
|
| 181 |
},
|
| 182 |
{
|
| 183 |
"unit": "Unit 6",
|
|
|
|
| 186 |
"min_result": -3.5,
|
| 187 |
"best_result": 0,
|
| 188 |
"best_model_id": "",
|
| 189 |
+
"passed_": False
|
| 190 |
},
|
| 191 |
{
|
| 192 |
"unit": "Unit 7",
|
|
|
|
| 195 |
"min_result": -100,
|
| 196 |
"best_result": 0,
|
| 197 |
"best_model_id": "",
|
| 198 |
+
"passed_": False
|
| 199 |
},
|
| 200 |
{
|
| 201 |
"unit": "Unit 8 PI",
|
|
|
|
| 204 |
"min_result": -100,
|
| 205 |
"best_result": 0,
|
| 206 |
"best_model_id": "",
|
| 207 |
+
"passed_": False
|
| 208 |
},
|
| 209 |
{
|
| 210 |
"unit": "Unit 8 PII",
|
|
|
|
| 213 |
"min_result": -100,
|
| 214 |
"best_result": 0,
|
| 215 |
"best_model_id": "",
|
| 216 |
+
"passed_": False
|
| 217 |
},
|
| 218 |
]
|
| 219 |
for unit in results_certification:
|
|
|
|
| 229 |
|
| 230 |
# Based on best_result do we pass the unit?
|
| 231 |
check_if_passed(unit)
|
| 232 |
+
unit["passed"] = pass_emoji(unit["passed_"])
|
| 233 |
|
| 234 |
print(results_certification)
|
| 235 |
|
|
|
|
| 256 |
hf_username = gr.Textbox(placeholder="ThomasSimonini", label="Your Hugging Face Username")
|
| 257 |
#email = gr.Textbox(placeholder="[email protected]", label="Your Email (to receive your certificate)")
|
| 258 |
check_progress_button = gr.Button(value="Check my progress")
|
| 259 |
+
output = gr.components.Dataframe(value= certification(hf_username), headers=["Pass?", "Unit", "Environment", "Baseline", "Your best result", "Your best model id"], datatype=["markdown", "markdown", "markdown", "number", "number", "markdown", "bool"])
|
| 260 |
check_progress_button.click(fn=certification, inputs=hf_username, outputs=output)
|
| 261 |
|
| 262 |
demo.launch()
|