Update app.py
Browse files
app.py
CHANGED
@@ -44,14 +44,17 @@ def text_extract(file):
|
|
44 |
result="hi"
|
45 |
|
46 |
|
47 |
-
return 'result'
|
|
|
|
|
48 |
|
|
|
|
|
49 |
with gr.Blocks() as demo:
|
50 |
gr.Markdown("# Chat with ChatGPT-like Interface")
|
51 |
|
52 |
chatbot = gr.Chatbot()
|
53 |
state = gr.State([])
|
54 |
-
|
55 |
with gr.Row():
|
56 |
with gr.Column():
|
57 |
user_input = gr.Textbox(show_label=False, placeholder="Type your message here...")
|
@@ -59,10 +62,9 @@ with gr.Blocks() as demo:
|
|
59 |
with gr.Column():
|
60 |
input_file=gr.File(label="Upload PDF", file_count="single")
|
61 |
submit_btn=gr.Button("Submit")
|
62 |
-
submit_btn.click(
|
63 |
#send_btn.click(chatbot_response,[user_input,state],[chatbot, state])
|
64 |
|
65 |
if __name__ == "__main__":
|
66 |
embeddings=GooglePalmEmbeddings(google_api_key=google_api)
|
67 |
demo.launch()
|
68 |
-
#u
|
|
|
44 |
result="hi"
|
45 |
|
46 |
|
47 |
+
return result['result']
|
48 |
+
def text_extract1(file):
|
49 |
+
return 'hi';
|
50 |
|
51 |
+
|
52 |
+
|
53 |
with gr.Blocks() as demo:
|
54 |
gr.Markdown("# Chat with ChatGPT-like Interface")
|
55 |
|
56 |
chatbot = gr.Chatbot()
|
57 |
state = gr.State([])
|
|
|
58 |
with gr.Row():
|
59 |
with gr.Column():
|
60 |
user_input = gr.Textbox(show_label=False, placeholder="Type your message here...")
|
|
|
62 |
with gr.Column():
|
63 |
input_file=gr.File(label="Upload PDF", file_count="single")
|
64 |
submit_btn=gr.Button("Submit")
|
65 |
+
submit_btn.click(text_extract1, [input_file], [user_input])
|
66 |
#send_btn.click(chatbot_response,[user_input,state],[chatbot, state])
|
67 |
|
68 |
if __name__ == "__main__":
|
69 |
embeddings=GooglePalmEmbeddings(google_api_key=google_api)
|
70 |
demo.launch()
|
|