Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -32,58 +32,25 @@ def chat(prompt, selected_agents):
|
|
32 |
except Exception as e:
|
33 |
output = f"[ERROR: {e}]"
|
34 |
responses[name] = output
|
35 |
-
return [responses] # ✅
|
36 |
|
37 |
iface = gr.Interface(
|
38 |
fn=chat,
|
39 |
inputs=[
|
40 |
-
gr.Textbox(
|
41 |
-
label="Ask Anything",
|
42 |
-
lines=4,
|
43 |
-
placeholder="Ask your question here...",
|
44 |
-
elem_id="chat-input"
|
45 |
-
),
|
46 |
gr.CheckboxGroup(
|
47 |
choices=list(agent_map.keys()),
|
48 |
label="Choose Which Personalities to Ask",
|
49 |
-
value=list(agent_map.keys()) #
|
50 |
)
|
51 |
],
|
52 |
outputs=gr.JSON(label="Responses"),
|
53 |
title="PerspectiveAI",
|
54 |
description=(
|
55 |
-
"Ask
|
56 |
-
"Created by Aymn
|
57 |
-
"[
|
58 |
-
|
59 |
-
"[Instagram](https://www.instagram.com/damnn_aymn/) · "
|
60 |
-
"[X](https://x.com/Aymn51414199) · "
|
61 |
-
"[Hugging Face](https://huggingface.co/spaces/aymnsk)"
|
62 |
-
),
|
63 |
-
theme=gr.themes.Soft(
|
64 |
-
primary_hue="blue",
|
65 |
-
secondary_hue="gray",
|
66 |
-
font=[gr.themes.GoogleFont("Inter")],
|
67 |
-
radius_size=gr.themes.sizes.radius_md,
|
68 |
-
spacing_size=gr.themes.sizes.spacing_md
|
69 |
-
),
|
70 |
-
css="""
|
71 |
-
#chat-input textarea {
|
72 |
-
font-size: 1.1rem;
|
73 |
-
padding: 12px;
|
74 |
-
background: #1e1e2f;
|
75 |
-
color: white;
|
76 |
-
border-radius: 12px;
|
77 |
-
}
|
78 |
-
body {
|
79 |
-
background-color: #111827;
|
80 |
-
color: white;
|
81 |
-
font-family: 'Inter', sans-serif;
|
82 |
-
}
|
83 |
-
.gr-box {
|
84 |
-
border: none;
|
85 |
-
}
|
86 |
-
"""
|
87 |
)
|
88 |
|
89 |
iface.launch()
|
|
|
32 |
except Exception as e:
|
33 |
output = f"[ERROR: {e}]"
|
34 |
responses[name] = output
|
35 |
+
return [responses] # ✅ Required for Gradio API structure
|
36 |
|
37 |
iface = gr.Interface(
|
38 |
fn=chat,
|
39 |
inputs=[
|
40 |
+
gr.Textbox(label="Ask Anything", lines=4, placeholder="Ask your question here..."),
|
|
|
|
|
|
|
|
|
|
|
41 |
gr.CheckboxGroup(
|
42 |
choices=list(agent_map.keys()),
|
43 |
label="Choose Which Personalities to Ask",
|
44 |
+
value=list(agent_map.keys()) # All selected by default
|
45 |
)
|
46 |
],
|
47 |
outputs=gr.JSON(label="Responses"),
|
48 |
title="PerspectiveAI",
|
49 |
description=(
|
50 |
+
"Ask your question and get multiple expert takes 🤖\n\n"
|
51 |
+
"Created by Aymn | [GitHub](https://github.com/aymnsk) · "
|
52 |
+
"[Instagram](https://instagram.com/damnn_aymn)"
|
53 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
)
|
55 |
|
56 |
iface.launch()
|