with gr.Blocks() as demo:
with gr.Row():
with gr.Column():
file_input = gr.File(file_count="multiple", file_types=["text", ".json", ".csv", ".pdf"], type= 'binary')
initiate_btn = gr.Button(value="Generate Embedding")
with gr.Column():
question = gr.Textbox(label="Question")
question_btn = gr.Button(value="Question_btn")
answer = gr.Textbox(label="answer")
initiate_btn.click(embed_documents, inputs=file_input, api_name="embed-file")
question_btn.click(retrieve_documents, inputs=question , outputs=answer, api_name="llm")
demo.launch(debug= True)
I have this code that is giving a connection timed-out error after I upload one single file.