Spaces:
Runtime error
Runtime error
Upload app.py with huggingface_hub
Browse files
app.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
import gradio as gr
|
| 3 |
+
import subprocess
|
| 4 |
+
import os
|
| 5 |
+
|
| 6 |
+
def run_diagnostic():
|
| 7 |
+
try:
|
| 8 |
+
# Run the diagnostic script and capture output
|
| 9 |
+
result = subprocess.run(
|
| 10 |
+
["python3", "debug_model_loading.py"],
|
| 11 |
+
capture_output=True,
|
| 12 |
+
text=True,
|
| 13 |
+
check=False
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
# Combine stdout and stderr
|
| 17 |
+
output = result.stdout + "\n" + result.stderr
|
| 18 |
+
return output
|
| 19 |
+
except Exception as e:
|
| 20 |
+
return f"Error running diagnostic: {str(e)}"
|
| 21 |
+
|
| 22 |
+
with gr.Blocks(title="Model Loading Diagnostic") as demo:
|
| 23 |
+
gr.Markdown("# InternVL2 Model Loading Diagnostic")
|
| 24 |
+
|
| 25 |
+
with gr.Row():
|
| 26 |
+
run_btn = gr.Button("Run Diagnostic")
|
| 27 |
+
output = gr.Textbox(label="Diagnostic Output", lines=30)
|
| 28 |
+
|
| 29 |
+
run_btn.click(fn=run_diagnostic, inputs=[], outputs=output)
|
| 30 |
+
|
| 31 |
+
# Run diagnostic on startup
|
| 32 |
+
demo.load(fn=run_diagnostic, inputs=[], outputs=output)
|
| 33 |
+
|
| 34 |
+
demo.launch(server_name="0.0.0.0")
|
| 35 |
+
|