Spaces:
Runtime error
Runtime error
Update main.py
Browse files
main.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
-
from nicegui import ui, run
|
| 3 |
import requests
|
| 4 |
import zipfile
|
| 5 |
import io
|
|
@@ -128,9 +128,13 @@ def download_and_process_repo(repo_url: str, branch_or_tag: str, log: ui.log) ->
|
|
| 128 |
log.push("✅ Processing complete.")
|
| 129 |
return file_contents
|
| 130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
| 132 |
# --- NiceGUI User Interface Definition ---
|
| 133 |
-
|
| 134 |
@ui.page('/')
|
| 135 |
def main_page():
|
| 136 |
"""Defines the layout and functionality of the web interface."""
|
|
@@ -221,4 +225,4 @@ def main_page():
|
|
| 221 |
|
| 222 |
|
| 223 |
# NiceGUI application on port 8080
|
| 224 |
-
ui.run(host='0.0.0.0', port=8080)
|
|
|
|
| 1 |
#!/usr/bin/env python3
|
| 2 |
+
from nicegui import ui, run, app
|
| 3 |
import requests
|
| 4 |
import zipfile
|
| 5 |
import io
|
|
|
|
| 128 |
log.push("✅ Processing complete.")
|
| 129 |
return file_contents
|
| 130 |
|
| 131 |
+
# --- Dedicated health check endpoint ---
|
| 132 |
+
@app.get('/health')
|
| 133 |
+
def health_check():
|
| 134 |
+
"""A simple endpoint for the Hugging Face health checker."""
|
| 135 |
+
return "OK", 200
|
| 136 |
|
| 137 |
# --- NiceGUI User Interface Definition ---
|
|
|
|
| 138 |
@ui.page('/')
|
| 139 |
def main_page():
|
| 140 |
"""Defines the layout and functionality of the web interface."""
|
|
|
|
| 225 |
|
| 226 |
|
| 227 |
# NiceGUI application on port 8080
|
| 228 |
+
ui.run(host='0.0.0.0', port=8080, storage_secret='MAGIC')
|