app-knmojt-13 / app.py
AiCoderv2's picture
Deploy Gradio app with multiple files
9f9394b verified
raw
history blame
1.95 kB
#
# SPDX-FileCopyrightText: Hadad <hadad@linuxmail.org>
# SPDX-License-Identifier: Apache-2.0
#
from src.chat.handler import chat
from config import DESCRIPTION
import gradio as gr
with gr.Blocks(fill_height=True, fill_width=True) as app:
with gr.Sidebar():
gr.HTML(DESCRIPTION)
gr.ChatInterface(
fn=chat,
chatbot=gr.Chatbot(
label="SearchGPT | V3",
type="messages",
show_copy_button=True,
scale=1
),
type="messages",
multimodal=True,
flagging_mode="manual",
flagging_dir="/app",
examples=[
["Introduce yourself fully without withholding anything"],
["Give me a short introduction to large language model"],
["Open this link https://huggingface.co/spaces?sort=trending and check what is currently trending?"],
["Find information about UltimaX Intelligence"],
["DeepSeek has just released DeepSeek V3.2, can you find out more?"],
["Find information for me about SearchGPT by umint and directly compare it with ChatGPT Search and Perplexity"],
["Please find information online regarding the current trends for this month"],
["Find information related to the dangers of AI addiction, including real-life examples"],
["Search for images related to artificial intelligence"],
[{"text": "Find similar themes online (using web search) as shown in this image",
"files": ["assets/images/ai-generated.png"]}]
],
cache_examples=False,
textbox=gr.MultimodalTextbox(
file_types=["image"],
placeholder="Ask SearchGPT anything…",
stop_btn=True
),
show_api=False
)
app.queue(
max_size=1,
default_concurrency_limit=1
).launch(
server_name="0.0.0.0",
pwa=True,
max_file_size="1mb",
mcp_server=True
)