Spaces:
Runtime error
Runtime error
Commit
·
c560874
1
Parent(s):
04e36cb
Update app.py
Browse files
app.py
CHANGED
@@ -12,12 +12,7 @@ with gr.Blocks() as demo:
|
|
12 |
with gr.Row():
|
13 |
collection_name = gr.components.Textbox(
|
14 |
label='Document name')
|
15 |
-
|
16 |
-
# label='Pinecone environment')
|
17 |
-
# pinecone_index_name = gr.components.Textbox(
|
18 |
-
# label='Pinecone index name')
|
19 |
-
# openai_api_key = gr.components.Textbox(
|
20 |
-
# label='Openai API key', type='password')
|
21 |
with gr.Row():
|
22 |
with gr.Column():
|
23 |
file = gr.components.File(
|
@@ -35,9 +30,17 @@ with gr.Blocks() as demo:
|
|
35 |
|
36 |
upload.click(create_indexes, [
|
37 |
file,collection_name], [label])
|
38 |
-
|
39 |
-
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
demo.launch()
|
42 |
|
43 |
# # Retrieve the serialized list of username and password pairs from environment variable
|
|
|
12 |
with gr.Row():
|
13 |
collection_name = gr.components.Textbox(
|
14 |
label='Document name')
|
15 |
+
|
|
|
|
|
|
|
|
|
|
|
16 |
with gr.Row():
|
17 |
with gr.Column():
|
18 |
file = gr.components.File(
|
|
|
30 |
|
31 |
upload.click(create_indexes, [
|
32 |
file,collection_name], [label])
|
33 |
+
|
34 |
+
with gr.Row():
|
35 |
+
# ... Other components ...
|
36 |
+
source_document_textbox = gr.components.Textbox(
|
37 |
+
label='Source Document',
|
38 |
+
type='text',
|
39 |
+
default='',
|
40 |
+
lines=10, # Set the number of lines to display multiple documents
|
41 |
+
)
|
42 |
+
submit_button.click(create_conversation, [msg, chatbot, collection_name], [msg, chatbot])
|
43 |
+
msg.submit(create_conversation, [msg, chatbot, collection_name], [msg, chatbot, source_document_textbox])
|
44 |
demo.launch()
|
45 |
|
46 |
# # Retrieve the serialized list of username and password pairs from environment variable
|