Spaces:
Sleeping
Sleeping
Evgueni Poloukarov
commited on
Commit
·
dbf2a77
1
Parent(s):
4736327
fix: revert app.py to working version (remove broken diagnostic code)
Browse files
app.py
CHANGED
|
@@ -67,48 +67,6 @@ def forecast_api(run_date_str, forecast_type):
|
|
| 67 |
return error_path
|
| 68 |
|
| 69 |
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
def run_diagnostic():
|
| 73 |
-
"""Run comprehensive diagnostic tests. Returns path to report file."""
|
| 74 |
-
import subprocess
|
| 75 |
-
import sys
|
| 76 |
-
|
| 77 |
-
output_path = "/tmp/diagnostic_report.txt"
|
| 78 |
-
|
| 79 |
-
try:
|
| 80 |
-
result = subprocess.run(
|
| 81 |
-
[sys.executable, "diagnostic.py"],
|
| 82 |
-
capture_output=True,
|
| 83 |
-
text=True,
|
| 84 |
-
timeout=600
|
| 85 |
-
)
|
| 86 |
-
|
| 87 |
-
with open(output_path, 'w') as f:
|
| 88 |
-
f.write("=== DIAGNOSTIC REPORT ===
|
| 89 |
-
|
| 90 |
-
")
|
| 91 |
-
f.write("STDOUT:
|
| 92 |
-
" + result.stdout)
|
| 93 |
-
f.write("
|
| 94 |
-
|
| 95 |
-
STDERR:
|
| 96 |
-
" + result.stderr)
|
| 97 |
-
f.write(f"
|
| 98 |
-
|
| 99 |
-
Return code: {result.returncode}
|
| 100 |
-
")
|
| 101 |
-
|
| 102 |
-
print(f"Diagnostic completed: {output_path}")
|
| 103 |
-
except Exception as e:
|
| 104 |
-
with open(output_path, 'w') as f:
|
| 105 |
-
f.write(f"Diagnostic ERROR: {str(e)}
|
| 106 |
-
")
|
| 107 |
-
import traceback
|
| 108 |
-
f.write(traceback.format_exc())
|
| 109 |
-
|
| 110 |
-
return output_path
|
| 111 |
-
|
| 112 |
# Build Gradio interface
|
| 113 |
with gr.Blocks(title="FBMC Chronos-2 Forecasting") as demo:
|
| 114 |
gr.Markdown("""
|
|
@@ -160,15 +118,6 @@ with gr.Blocks(title="FBMC Chronos-2 Forecasting") as demo:
|
|
| 160 |
- Precision: bfloat16
|
| 161 |
""")
|
| 162 |
|
| 163 |
-
|
| 164 |
-
gr.Markdown("---")
|
| 165 |
-
gr.Markdown("### Diagnostics")
|
| 166 |
-
with gr.Row():
|
| 167 |
-
diagnostic_btn = gr.Button("Run Diagnostics", variant="secondary")
|
| 168 |
-
diagnostic_output = gr.File(label="Diagnostic Report", type="filepath")
|
| 169 |
-
|
| 170 |
-
diagnostic_btn.click(fn=run_diagnostic, inputs=[], outputs=diagnostic_output)
|
| 171 |
-
|
| 172 |
# Wire up the interface
|
| 173 |
submit_btn.click(
|
| 174 |
fn=forecast_api,
|
|
|
|
| 67 |
return error_path
|
| 68 |
|
| 69 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
# Build Gradio interface
|
| 71 |
with gr.Blocks(title="FBMC Chronos-2 Forecasting") as demo:
|
| 72 |
gr.Markdown("""
|
|
|
|
| 118 |
- Precision: bfloat16
|
| 119 |
""")
|
| 120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
# Wire up the interface
|
| 122 |
submit_btn.click(
|
| 123 |
fn=forecast_api,
|