AIencoder commited on
Commit
af458f8
·
verified ·
1 Parent(s): 636da78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -490,7 +490,8 @@ dark_theme = gr.themes.Soft(
490
 
491
  # ===== UI =====
492
 
493
- with gr.Blocks(title="Axon v6", theme=dark_theme) as demo:
 
494
 
495
  # State for theme
496
  is_dark = gr.State(True)
@@ -590,7 +591,7 @@ with gr.Blocks(title="Axon v6", theme=dark_theme) as demo:
590
 
591
  # ===== CHAT =====
592
  with gr.TabItem("💬 Chat"):
593
- chatbot = gr.Chatbot(height=400, type="messages")
594
  with gr.Row():
595
  msg = gr.Textbox(placeholder="Ask anything...", show_label=False, scale=8)
596
  send = gr.Button("Send", variant="primary", scale=1)
@@ -622,7 +623,7 @@ with gr.Blocks(title="Axon v6", theme=dark_theme) as demo:
622
  # ===== EXPLAIN =====
623
  with gr.TabItem("🔍 Explain"):
624
  with gr.Row():
625
- with gr.Column():
626
  explain_input = gr.Code(label="Code", lines=10)
627
  explain_detail = gr.Radio(["Brief", "Normal", "Detailed"], value="Normal")
628
  explain_btn = gr.Button("🔍 Explain", variant="primary")
@@ -878,4 +879,5 @@ with gr.Blocks(title="Axon v6", theme=dark_theme) as demo:
878
  print("🔥 Preloading model...")
879
  load_model("🚀 Qwen2.5 Coder 3B (Fast)")
880
 
881
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
 
490
 
491
  # ===== UI =====
492
 
493
+ # NOTE: Theme and title moved to launch() for Gradio 5+ compatibility
494
+ with gr.Blocks() as demo:
495
 
496
  # State for theme
497
  is_dark = gr.State(True)
 
591
 
592
  # ===== CHAT =====
593
  with gr.TabItem("💬 Chat"):
594
+ chatbot = gr.Chatbot(height=400) # Removed type="messages"
595
  with gr.Row():
596
  msg = gr.Textbox(placeholder="Ask anything...", show_label=False, scale=8)
597
  send = gr.Button("Send", variant="primary", scale=1)
 
623
  # ===== EXPLAIN =====
624
  with gr.TabItem("🔍 Explain"):
625
  with gr.Row():
626
+ with Column():
627
  explain_input = gr.Code(label="Code", lines=10)
628
  explain_detail = gr.Radio(["Brief", "Normal", "Detailed"], value="Normal")
629
  explain_btn = gr.Button("🔍 Explain", variant="primary")
 
879
  print("🔥 Preloading model...")
880
  load_model("🚀 Qwen2.5 Coder 3B (Fast)")
881
 
882
+ # Theme and title are now passed here to avoid the UserWarning
883
+ demo.launch(server_name="0.0.0.0", server_port=7860, theme=dark_theme, title="Axon v6")