Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -147,23 +147,24 @@ def process_and_query(state, question):
|
|
147 |
def main():
|
148 |
upload_interface = gr.Interface(
|
149 |
fn=upload_files,
|
150 |
-
inputs=gr.File(label="Upload PDF or DOCX files",
|
151 |
-
outputs=gr.Textbox(label="Upload Status")
|
152 |
)
|
153 |
|
154 |
query_interface = gr.Interface(
|
155 |
fn=process_and_query,
|
156 |
-
inputs=[gr.State
|
157 |
-
outputs=[gr.Textbox(label="Query Response"), gr.State
|
158 |
)
|
159 |
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
|
|
167 |
|
168 |
if __name__ == "__main__":
|
169 |
main()
|
|
|
147 |
def main():
|
148 |
upload_interface = gr.Interface(
|
149 |
fn=upload_files,
|
150 |
+
inputs=gr.inputs.File(label="Upload PDF or DOCX files", multiple=True),
|
151 |
+
outputs=gr.outputs.Textbox(label="Upload Status")
|
152 |
)
|
153 |
|
154 |
query_interface = gr.Interface(
|
155 |
fn=process_and_query,
|
156 |
+
inputs=[gr.inputs.Textbox(label="Conversation State"), gr.inputs.Textbox(label="Enter your query")],
|
157 |
+
outputs=[gr.outputs.Textbox(label="Query Response"), gr.outputs.Textbox(label="Conversation State")]
|
158 |
)
|
159 |
|
160 |
+
gr.Interface(
|
161 |
+
fn=None,
|
162 |
+
inputs=[
|
163 |
+
gr.Interface.Tab("Upload Files", upload_interface),
|
164 |
+
gr.Interface.Tab("Query", query_interface)
|
165 |
+
],
|
166 |
+
outputs=gr.outputs.Textbox(label="Output", default="Output will be shown here")
|
167 |
+
).launch()
|
168 |
|
169 |
if __name__ == "__main__":
|
170 |
main()
|