File size: 1,967 Bytes
3421713
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import gradio as gr
from agents import init_agent

agent=init_agent()
def run_agent(query):
    # Assuming the agent has a method to run a query
    response=agent.run(query,reset=False)
    if isinstance(response, list):
        response="\n".join(response)
    return response
query_input = gr.Textbox(
    label="Query",
    placeholder="Enter your query here...",
    lines=3,
    max_lines=5
)

output=gr.TextArea(
    label="Response",
    placeholder="The response will appear here...",
    lines=10,
    max_lines=20
)

demo = gr.Interface(
    fn=run_agent,
    inputs=query_input,
    outputs=output,
    title="AtlasIA Assistant",
    description="Ask me anything and I'll help you find the information you need.",
    theme=gr.themes.Soft(),
    examples=[
        ["names of datasets with image modality"],
        ["what is the most 3 liked datasets"],
        ["find the most downloaded model"],
        ["Who are the members of Atlasia?"],
        ["what is atlasIA community in 3 lines??"],
        ["how i can join the community?"],
        ["how i can contribute to the community?"]
    ],
    cache_examples=True,
    flagging_mode="never",
    css="""
        .gradio-container {
            max-width: 800px;
            margin: auto;
        }
        .gradio-interface {
            padding: 2rem;
        }
        .output-text {
            white-space: pre-wrap;
            font-family: 'Courier New', monospace;
            background-color: #f5f5f5;
            padding: 1rem;
            border-radius: 5px;
            border: 1px solid #ddd;
        }
        .input-text {
            font-size: 1.1em;
        }
        .title {
            font-size: 2em;
            font-weight: bold;
            margin-bottom: 1rem;
        }
        .description {
            font-size: 1.2em;
            color: #666;
            margin-bottom: 2rem;
        }
    """
)
if __name__=="__main__":
    # Initialize the agent
    demo.launch()