Spaces:
Runtime error
Runtime error
Update layout
Browse files
app.py
CHANGED
@@ -133,17 +133,6 @@ with gr.Blocks() as demo:
|
|
133 |
)
|
134 |
|
135 |
with gr.Row():
|
136 |
-
|
137 |
-
def upload_file(file):
|
138 |
-
update_context_url(file.name)
|
139 |
-
|
140 |
-
upload_button = gr.UploadButton(
|
141 |
-
"Upload Document",
|
142 |
-
file_types=[f".{i}" for i in TEXT_FORMATS],
|
143 |
-
file_count="single",
|
144 |
-
)
|
145 |
-
upload_button.upload(upload_file, upload_button)
|
146 |
-
|
147 |
def update_config(config_list):
|
148 |
global assistant, ragproxyagent
|
149 |
config_list = autogen.config_list_from_models(
|
@@ -220,14 +209,25 @@ with gr.Blocks() as demo:
|
|
220 |
|
221 |
clear = gr.ClearButton([txt_input, chatbot])
|
222 |
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
|
232 |
txt_prompt = gr.Textbox(
|
233 |
label="Enter your prompt for Retrieve Agent and press enter to replace the default prompt",
|
|
|
133 |
)
|
134 |
|
135 |
with gr.Row():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
def update_config(config_list):
|
137 |
global assistant, ragproxyagent
|
138 |
config_list = autogen.config_list_from_models(
|
|
|
209 |
|
210 |
clear = gr.ClearButton([txt_input, chatbot])
|
211 |
|
212 |
+
with gr.Row():
|
213 |
+
def upload_file(file):
|
214 |
+
update_context_url(file.name)
|
215 |
+
|
216 |
+
upload_button = gr.UploadButton(
|
217 |
+
"Click to upload a context file or enter a url in the right textbox",
|
218 |
+
file_types=[f".{i}" for i in TEXT_FORMATS],
|
219 |
+
file_count="single",
|
220 |
+
)
|
221 |
+
upload_button.upload(upload_file, upload_button)
|
222 |
+
|
223 |
+
txt_context_url = gr.Textbox(
|
224 |
+
label="Enter the url to your context file and chat on the context",
|
225 |
+
info=f"File must be in the format of [{', '.join(TEXT_FORMATS)}]",
|
226 |
+
max_lines=1,
|
227 |
+
show_label=True,
|
228 |
+
value="https://raw.githubusercontent.com/microsoft/autogen/main/README.md",
|
229 |
+
container=True,
|
230 |
+
)
|
231 |
|
232 |
txt_prompt = gr.Textbox(
|
233 |
label="Enter your prompt for Retrieve Agent and press enter to replace the default prompt",
|