Spaces:
Running
Running
small updates
Browse files
app.py
CHANGED
@@ -77,6 +77,8 @@ def create_ui():
|
|
77 |
justify-content: center;
|
78 |
font-weight: bold;
|
79 |
color: white;
|
|
|
|
|
80 |
}
|
81 |
.status-waiting {
|
82 |
background-color: #9e9e9e;
|
@@ -111,11 +113,11 @@ def create_ui():
|
|
111 |
if file is None:
|
112 |
return """<div class="progress-container">
|
113 |
<div class="progress-status">Ready for upload</div>
|
114 |
-
</div>"""
|
115 |
|
116 |
return """<div class="progress-container">
|
117 |
<div class="progress-status">β
File uploaded successfully</div>
|
118 |
-
</div>"""
|
119 |
|
120 |
def on_validate(file):
|
121 |
if file is None:
|
@@ -134,7 +136,7 @@ def create_ui():
|
|
134 |
|
135 |
html += f'''
|
136 |
<div class="validation-step" id="step-{i}">
|
137 |
-
<div class="step-header" onclick="
|
138 |
<div class="step-status {status_class}">{status_icon}</div>
|
139 |
<div class="step-title">{test_name}</div>
|
140 |
</div>
|
@@ -146,28 +148,14 @@ def create_ui():
|
|
146 |
|
147 |
html += '</div>'
|
148 |
|
149 |
-
# Add JavaScript to handle toggling details
|
150 |
-
html += '''
|
151 |
-
<script>
|
152 |
-
function toggleDetails(id) {
|
153 |
-
const details = document.getElementById('details-' + id);
|
154 |
-
if (details.style.display === 'none') {
|
155 |
-
details.style.display = 'block';
|
156 |
-
} else {
|
157 |
-
details.style.display = 'none';
|
158 |
-
}
|
159 |
-
}
|
160 |
-
</script>
|
161 |
-
'''
|
162 |
-
|
163 |
return gr.update(value=html, visible=True)
|
164 |
|
165 |
-
file_input.change(on_file_upload, inputs=file_input, outputs=upload_progress)
|
166 |
validate_btn.click(on_validate, inputs=file_input, outputs=validation_results)
|
167 |
|
168 |
gr.HTML("""
|
169 |
<div style="text-align: center; margin-top: 20px;">
|
170 |
-
<p>Based on the <a href="https://github.com/mlcommons/croissant" target="_blank">Croissant
|
171 |
</div>
|
172 |
""")
|
173 |
|
|
|
77 |
justify-content: center;
|
78 |
font-weight: bold;
|
79 |
color: white;
|
80 |
+
font-size: 16px;
|
81 |
+
text-shadow: 0px 0px 1px rgba(0,0,0,0.5);
|
82 |
}
|
83 |
.status-waiting {
|
84 |
background-color: #9e9e9e;
|
|
|
113 |
if file is None:
|
114 |
return """<div class="progress-container">
|
115 |
<div class="progress-status">Ready for upload</div>
|
116 |
+
</div>""", gr.update(visible=False)
|
117 |
|
118 |
return """<div class="progress-container">
|
119 |
<div class="progress-status">β
File uploaded successfully</div>
|
120 |
+
</div>""", gr.update()
|
121 |
|
122 |
def on_validate(file):
|
123 |
if file is None:
|
|
|
136 |
|
137 |
html += f'''
|
138 |
<div class="validation-step" id="step-{i}">
|
139 |
+
<div class="step-header" onclick="document.getElementById('details-{i}').style.display = document.getElementById('details-{i}').style.display === 'none' ? 'block' : 'none'">
|
140 |
<div class="step-status {status_class}">{status_icon}</div>
|
141 |
<div class="step-title">{test_name}</div>
|
142 |
</div>
|
|
|
148 |
|
149 |
html += '</div>'
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
return gr.update(value=html, visible=True)
|
152 |
|
153 |
+
file_input.change(on_file_upload, inputs=file_input, outputs=[upload_progress, validation_results])
|
154 |
validate_btn.click(on_validate, inputs=file_input, outputs=validation_results)
|
155 |
|
156 |
gr.HTML("""
|
157 |
<div style="text-align: center; margin-top: 20px;">
|
158 |
+
<p>Based on the <a href="https://github.com/mlcommons/croissant" target="_blank">Croissant format</a> from MLCommons.</p>
|
159 |
</div>
|
160 |
""")
|
161 |
|