File size: 973 Bytes
961e80c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

import gradio as gr
import subprocess
import os

def run_diagnostic():
    try:
        # Run the diagnostic script and capture output
        result = subprocess.run(
            ["python3", "debug_model_loading.py"], 
            capture_output=True, 
            text=True,
            check=False
        )
        
        # Combine stdout and stderr
        output = result.stdout + "\n" + result.stderr
        return output
    except Exception as e:
        return f"Error running diagnostic: {str(e)}"

with gr.Blocks(title="Model Loading Diagnostic") as demo:
    gr.Markdown("# InternVL2 Model Loading Diagnostic")
    
    with gr.Row():
        run_btn = gr.Button("Run Diagnostic")
        output = gr.Textbox(label="Diagnostic Output", lines=30)
    
    run_btn.click(fn=run_diagnostic, inputs=[], outputs=output)
    
    # Run diagnostic on startup
    demo.load(fn=run_diagnostic, inputs=[], outputs=output)

demo.launch(server_name="0.0.0.0")