Update app.py
Browse files
app.py
CHANGED
|
@@ -2,19 +2,25 @@ import gradio as gr
|
|
| 2 |
from model_loader import load_model
|
| 3 |
from assistant import get_assistant_response
|
| 4 |
|
|
|
|
| 5 |
pipe = load_model()
|
| 6 |
|
|
|
|
| 7 |
demo = gr.Interface(
|
| 8 |
fn=lambda command, execute: get_assistant_response(pipe, command, execute),
|
| 9 |
inputs=[
|
| 10 |
-
gr.Textbox(lines=2, placeholder="e.g. Open Chrome or Take a screenshot"),
|
| 11 |
gr.Checkbox(label="🛠️ Execute command (if possible)")
|
| 12 |
],
|
| 13 |
outputs="text",
|
| 14 |
title="🧠 Smart AI Assistant",
|
| 15 |
-
description=
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
flagging_mode="never"
|
| 17 |
)
|
| 18 |
|
| 19 |
if __name__ == "__main__":
|
| 20 |
-
demo.launch()
|
|
|
|
| 2 |
from model_loader import load_model
|
| 3 |
from assistant import get_assistant_response
|
| 4 |
|
| 5 |
+
# Load model pipeline
|
| 6 |
pipe = load_model()
|
| 7 |
|
| 8 |
+
# Gradio UI
|
| 9 |
demo = gr.Interface(
|
| 10 |
fn=lambda command, execute: get_assistant_response(pipe, command, execute),
|
| 11 |
inputs=[
|
| 12 |
+
gr.Textbox(lines=2, placeholder="e.g. Open Chrome or Take a screenshot", label="🧾 Command"),
|
| 13 |
gr.Checkbox(label="🛠️ Execute command (if possible)")
|
| 14 |
],
|
| 15 |
outputs="text",
|
| 16 |
title="🧠 Smart AI Assistant",
|
| 17 |
+
description=(
|
| 18 |
+
"AI assistant powered by Qwen2.5-VL.\n"
|
| 19 |
+
"Try commands like: 'Open Chrome', 'Take a screenshot', 'Create a file', or 'What is AI?'\n"
|
| 20 |
+
"Check the box to allow real OS command execution."
|
| 21 |
+
),
|
| 22 |
flagging_mode="never"
|
| 23 |
)
|
| 24 |
|
| 25 |
if __name__ == "__main__":
|
| 26 |
+
demo.launch(share=True, server_name="0.0.0.0", server_port=7860)
|