File size: 972 Bytes
f0608de
643e1b9
a6a995c
 
5983a12
f0608de
0b966fb
 
f0608de
 
140d8c6
0600a41
f0608de
 
 
 
 
ceac55e
9c4af10
ceac55e
f0608de
 
 
 
0600a41
643e1b9
f0608de
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from backend import handle_query
import gradio as gr


DESCRIPTION = """\
# <div style="text-align: center;">Odi, l'assistente ricercatore degli Osservatori</div>


👉 Retrieval-Augmented Generation - Ask me anything about the research carried out at the Osservatori.
"""


chat_interface =gr.ChatInterface(
        fn=handle_query, 
        chatbot=gr.Chatbot(height=500),
        textbox=gr.Textbox(placeholder="Chiedimi qualasiasi cosa relativa agli Osservatori", container=False, scale=7),
        #examples=[["Ciao, in cosa puoi aiutarmi?"],["Dimmi i risultati e le modalità di conduzione del censimento per favore"]]
        )

    
with gr.Blocks(css=".gradio-container {background-color: #B9D9EB}") as demo:
    gr.Markdown(DESCRIPTION)
    #gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
    chat_interface.render() 
    
if __name__ == "__main__":
    #progress = gr.Progress(track_tqdm=True)
    demo.launch()