File size: 897 Bytes
2c4b6d1
faeb998
9e2530d
 
b182aca
 
 
8fc19d7
3a18cdc
2c4b6d1
b182aca
ce942fe
b182aca
 
 
 
 
f55bbc0
b182aca
 
 
 
1b3da44
2c4b6d1
 
b182aca
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
from template.examples import examplesChatbot
from modules.respond import respond
import gradio as gr
import os

chatbot = gr.Chatbot(
    placeholder="<strong>Sou o Chatbot de Legislação da Unesp</strong><br>Fique à vontade para fazer perguntas",
    bubble_full_width=False,
    avatar_images=(None, "imgs/chatbot-avatar.png"),
    )
text = gr.Textbox(placeholder="Faça uma pergunta sobre a Legislação da Unesp", submit_btn=True)
dropbox = gr.Dropdown(["gpt-35-turbo", "gpt-4", "Phi-3-5-mini-instruct"], value="gpt-35-turbo", label='Modelo')
with gr.Blocks() as demo:
  chat = gr.ChatInterface(
      respond,
      textbox=text,
      additional_inputs=[
         dropbox,
      ],
      additional_inputs_accordion = 'Configurações',
      chatbot=chatbot,
  )
  examples_list = gr.Examples(examples=examplesChatbot, inputs=text)

if __name__ == "__main__":
    demo.launch(debug=True)