farmax commited on
Commit
87a53c5
1 Parent(s): 882bb4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -196,7 +196,6 @@ def demo():
196
  with gr.Row():
197
  qachain_btn = gr.Button("Inizializza Question Answering chain")
198
 
199
-
200
  with gr.Tab("Passo 4 - Chatbot"):
201
  chatbot = gr.Chatbot(height=300)
202
  with gr.Accordion("Opzioni avanzate - Riferimenti ai documenti", open=False):
@@ -209,6 +208,12 @@ def demo():
209
  with gr.Row():
210
  doc_source3 = gr.Textbox(label="Riferimento 3", lines=2, container=True, scale=20)
211
  source3_page = gr.Number(label="Pagina", scale=1)
 
 
 
 
 
 
212
  with gr.Row():
213
  msg = gr.Textbox(placeholder="Inserisci messaggio (es. 'Di cosa tratta questo documento?')", container=True)
214
  with gr.Row():
@@ -220,6 +225,7 @@ def demo():
220
  db_btn.click(initialize_database, \
221
  inputs=[document, slider_chunk_size, slider_chunk_overlap], \
222
  outputs=[vector_db, collection_name, db_progress])
 
223
  qachain_btn.click(initialize_LLM, \
224
  inputs=[llm_btn, slider_temperature, slider_maxtokens, slider_topk, vector_db], \
225
  outputs=[qa_chain, llm_progress]).then(lambda:[None, "", 0, "", 0, "", 0, "", 0, "", 0], \
@@ -263,6 +269,5 @@ def demo():
263
  )
264
  demo.queue().launch(debug=True)
265
 
266
-
267
  if __name__ == "__main__":
268
- demo()
 
196
  with gr.Row():
197
  qachain_btn = gr.Button("Inizializza Question Answering chain")
198
 
 
199
  with gr.Tab("Passo 4 - Chatbot"):
200
  chatbot = gr.Chatbot(height=300)
201
  with gr.Accordion("Opzioni avanzate - Riferimenti ai documenti", open=False):
 
208
  with gr.Row():
209
  doc_source3 = gr.Textbox(label="Riferimento 3", lines=2, container=True, scale=20)
210
  source3_page = gr.Number(label="Pagina", scale=1)
211
+ with gr.Row():
212
+ doc_source4 = gr.Textbox(label="Riferimento 4", lines=2, container=True, scale=20)
213
+ source4_page = gr.Number(label="Pagina", scale=1)
214
+ with gr.Row():
215
+ doc_source5 = gr.Textbox(label="Riferimento 5", lines=2, container=True, scale=20)
216
+ source5_page = gr.Number(label="Pagina", scale=1)
217
  with gr.Row():
218
  msg = gr.Textbox(placeholder="Inserisci messaggio (es. 'Di cosa tratta questo documento?')", container=True)
219
  with gr.Row():
 
225
  db_btn.click(initialize_database, \
226
  inputs=[document, slider_chunk_size, slider_chunk_overlap], \
227
  outputs=[vector_db, collection_name, db_progress])
228
+
229
  qachain_btn.click(initialize_LLM, \
230
  inputs=[llm_btn, slider_temperature, slider_maxtokens, slider_topk, vector_db], \
231
  outputs=[qa_chain, llm_progress]).then(lambda:[None, "", 0, "", 0, "", 0, "", 0, "", 0], \
 
269
  )
270
  demo.queue().launch(debug=True)
271
 
 
272
  if __name__ == "__main__":
273
+ demo()