Spaces:
Runtime error
Runtime error
Commit
·
207f427
1
Parent(s):
591bf90
Update gradio_app/interface.py
Browse filestemporary remove settings for fixed output
- gradio_app/interface.py +26 -19
gradio_app/interface.py
CHANGED
@@ -46,6 +46,10 @@ def create_gradio_interface():
|
|
46 |
<div align="center">
|
47 |
<a style="display:inline-block" href='https://github.com/nicelir1996/GPT-Swarm'><img src='https://img.shields.io/github/stars/nicelir1996/GPT-Swarm?style=social' /></a>
|
48 |
</div>
|
|
|
|
|
|
|
|
|
49 |
<br>
|
50 |
<div align="center">
|
51 |
⚠️⚠️We Highly recommend to use a duplicate space!⚠️⚠️
|
@@ -71,26 +75,26 @@ def create_gradio_interface():
|
|
71 |
|
72 |
# layout
|
73 |
with gr.Row():
|
74 |
-
with gr.Column(variant="panel", scale=0.4):
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
with gr.Accordion(label="Agents Setup:", open=False):
|
84 |
# Create a textbox for number of manager agents
|
85 |
-
n_managers = gr.Textbox(placeholder=get_swarm_agents_config()[0]["n"], label="Number of manager agents")
|
86 |
# Create a textbox for number of analyst agents
|
87 |
-
n_analysts = gr.Textbox(placeholder=get_swarm_agents_config()[1]["n"], label="Number of analyst agents")
|
88 |
# Create a textbox for number of googler agents
|
89 |
-
n_googlers = gr.Textbox(placeholder=get_swarm_agents_config()[2]["n"], label="Number of googler agents")
|
90 |
# create a submit button
|
91 |
|
92 |
# Create a container on the right for the outputs
|
93 |
-
with gr.Column(variant="panel", scale=
|
|
|
94 |
# Create a textbox for output
|
95 |
output_textbox = gr.Textbox(label="Output", lines=20)
|
96 |
# Create a textbox for logs
|
@@ -102,17 +106,20 @@ def create_gradio_interface():
|
|
102 |
def update_view_callback():
|
103 |
return display_logs(), display_output()
|
104 |
|
105 |
-
def submit_callback(
|
|
|
106 |
global SWARM_IS_RUNNING, SWARM_THREAD
|
107 |
if isinstance(SWARM_THREAD, threading.Thread):
|
108 |
SWARM_IS_RUNNING = SWARM_THREAD.is_alive()
|
109 |
print(f"Swarm is running. SWARM_IS_RUNNING = {SWARM_IS_RUNNING}")
|
110 |
if not SWARM_IS_RUNNING:
|
111 |
-
swarm_interface(
|
|
|
|
|
112 |
return display_logs(), display_output()
|
113 |
|
114 |
-
submit.click(submit_callback,
|
|
|
115 |
update_view_button.click(update_view_callback, outputs=[logs_textbox, output_textbox])
|
116 |
|
117 |
-
return demo
|
118 |
-
|
|
|
46 |
<div align="center">
|
47 |
<a style="display:inline-block" href='https://github.com/nicelir1996/GPT-Swarm'><img src='https://img.shields.io/github/stars/nicelir1996/GPT-Swarm?style=social' /></a>
|
48 |
</div>
|
49 |
+
<p align='center' style='font-size: 25px;'>⚠️Attention please⚠️! This version is specifically limited to the input of any case due to the heavy load on the server. We use the case 'VC evaluates the investment potential of Brainamics'</p>
|
50 |
+
<p align='center' style='font-size: 18px;'><b>Role: </b>professional venture capital agency, who has a proven track reckord of consistently funding successful startups</p>
|
51 |
+
<p align='center' style='font-size: 20px;'><b>Goal: </b>A new startup just send us their pitch. Find if the startup is worth investing in. The startup is called Brainamics and it is in the space of brain computer interfaces.</p>
|
52 |
+
|
53 |
<br>
|
54 |
<div align="center">
|
55 |
⚠️⚠️We Highly recommend to use a duplicate space!⚠️⚠️
|
|
|
75 |
|
76 |
# layout
|
77 |
with gr.Row():
|
78 |
+
# with gr.Column(variant="panel", scale=0.4):
|
79 |
+
# with gr.Accordion(label="Swarm goals (can leave empty for default)", open=False):
|
80 |
+
# # Create a textbox for swarm role
|
81 |
+
# swarm_role = gr.Textbox(placeholder=get_swarm_role(), label="Swarm role", disabled=True)
|
82 |
+
# # Create a textbox for swarm global goal
|
83 |
+
# swarm_global_goal = gr.Textbox(placeholder=get_swarm_global_goal(), label="Swarm global goal", disabled=True, description="⚠️Attention please⚠️! This version is specifically limited to the input of any case due to the heavy load on the server. We use the case \"VC evaluates the investment potential of Brainamics\"")
|
84 |
+
# # Create a list for swarm goals
|
85 |
+
# swarm_goals = gr.List(headers=None, col_count=(1, "fixed"), max_cols=1)
|
86 |
+
# with gr.Accordion(label="Agents Setup:", open=False):
|
|
|
87 |
# Create a textbox for number of manager agents
|
88 |
+
# n_managers = gr.Textbox(placeholder=get_swarm_agents_config()[0]["n"], label="Number of manager agents", disabled=True)
|
89 |
# Create a textbox for number of analyst agents
|
90 |
+
# n_analysts = gr.Textbox(placeholder=get_swarm_agents_config()[1]["n"], label="Number of analyst agents", disabled=True)
|
91 |
# Create a textbox for number of googler agents
|
92 |
+
# n_googlers = gr.Textbox(placeholder=get_swarm_agents_config()[2]["n"], label="Number of googler agents", disabled=True)
|
93 |
# create a submit button
|
94 |
|
95 |
# Create a container on the right for the outputs
|
96 |
+
with gr.Column(variant="panel", scale=1):
|
97 |
+
submit = gr.Button(value="Start the Swarm 🚀")
|
98 |
# Create a textbox for output
|
99 |
output_textbox = gr.Textbox(label="Output", lines=20)
|
100 |
# Create a textbox for logs
|
|
|
106 |
def update_view_callback():
|
107 |
return display_logs(), display_output()
|
108 |
|
109 |
+
def submit_callback():
|
110 |
+
# def submit_callback(swarm_role, swarm_global_goal, swarm_goals, n_managers, n_analysts, n_googlers):
|
111 |
global SWARM_IS_RUNNING, SWARM_THREAD
|
112 |
if isinstance(SWARM_THREAD, threading.Thread):
|
113 |
SWARM_IS_RUNNING = SWARM_THREAD.is_alive()
|
114 |
print(f"Swarm is running. SWARM_IS_RUNNING = {SWARM_IS_RUNNING}")
|
115 |
if not SWARM_IS_RUNNING:
|
116 |
+
swarm_interface()
|
117 |
+
# swarm_interface(swarm_role, swarm_global_goal, swarm_goals)
|
118 |
+
# swarm_interface(swarm_role, swarm_global_goal, swarm_goals, n_managers, n_analysts, n_googlers)
|
119 |
return display_logs(), display_output()
|
120 |
|
121 |
+
submit.click(submit_callback, outputs=[logs_textbox, output_textbox])
|
122 |
+
# submit.click(submit_callback, inputs=[swarm_role, swarm_global_goal, swarm_goals, n_managers, n_analysts, n_googlers], outputs=[logs_textbox, output_textbox])
|
123 |
update_view_button.click(update_view_callback, outputs=[logs_textbox, output_textbox])
|
124 |
|
125 |
+
return demo
|
|