Spaces:
Build error
Build error
Commit
·
560834a
1
Parent(s):
c1e3f7e
more
Browse files
app.py
CHANGED
|
@@ -44,7 +44,13 @@ for k, v in goal_dict.items():
|
|
| 44 |
r_coverage = 10
|
| 45 |
|
| 46 |
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
# ---------------------------- #
|
| 50 |
# functions
|
|
@@ -126,10 +132,7 @@ def move_agent(target_input: int):
|
|
| 126 |
# create animation
|
| 127 |
video_output = create_animation(path)
|
| 128 |
|
| 129 |
-
|
| 130 |
-
status = f'Went to target {target_input}.'
|
| 131 |
-
|
| 132 |
-
return video_output, status
|
| 133 |
|
| 134 |
|
| 135 |
def load_image_on_start():
|
|
@@ -169,7 +172,7 @@ def get_target_from_request(request_text):
|
|
| 169 |
|
| 170 |
def create_demo():
|
| 171 |
# main blocks
|
| 172 |
-
with gr.Blocks() as my_demo:
|
| 173 |
gr.Markdown("# Agent Control with Language")
|
| 174 |
gr.Markdown('Say the agent where to go and what to do')
|
| 175 |
|
|
@@ -179,7 +182,7 @@ def create_demo():
|
|
| 179 |
# send_btn = gr.Button(value='Send Request')
|
| 180 |
request_text = gr.Textbox(label="Request:", lines=2, interactive=False)
|
| 181 |
request_target = gr.Textbox(label='Target:', lines=2)
|
| 182 |
-
status = gr.Textbox(label='Status:', lines=2)
|
| 183 |
with gr.Column():
|
| 184 |
output_env = gr.Video(label="Env:", autoplay=True)
|
| 185 |
with gr.Accordion("TODO List", open=False):
|
|
|
|
| 44 |
r_coverage = 10
|
| 45 |
|
| 46 |
|
| 47 |
+
custom_css = """
|
| 48 |
+
#mytextbox textarea {
|
| 49 |
+
color: blue;
|
| 50 |
+
background-color: #f0f0f0;
|
| 51 |
+
font-weight: bold;
|
| 52 |
+
}
|
| 53 |
+
"""
|
| 54 |
|
| 55 |
# ---------------------------- #
|
| 56 |
# functions
|
|
|
|
| 132 |
# create animation
|
| 133 |
video_output = create_animation(path)
|
| 134 |
|
| 135 |
+
return video_output, f'Got it! I went to the goal number {target_input}.'
|
|
|
|
|
|
|
|
|
|
| 136 |
|
| 137 |
|
| 138 |
def load_image_on_start():
|
|
|
|
| 172 |
|
| 173 |
def create_demo():
|
| 174 |
# main blocks
|
| 175 |
+
with gr.Blocks(css=custom_css) as my_demo:
|
| 176 |
gr.Markdown("# Agent Control with Language")
|
| 177 |
gr.Markdown('Say the agent where to go and what to do')
|
| 178 |
|
|
|
|
| 182 |
# send_btn = gr.Button(value='Send Request')
|
| 183 |
request_text = gr.Textbox(label="Request:", lines=2, interactive=False)
|
| 184 |
request_target = gr.Textbox(label='Target:', lines=2)
|
| 185 |
+
status = gr.Textbox(label='Status:', lines=2, elem_id="mytextbox")
|
| 186 |
with gr.Column():
|
| 187 |
output_env = gr.Video(label="Env:", autoplay=True)
|
| 188 |
with gr.Accordion("TODO List", open=False):
|