Spaces:
Runtime error
Runtime error
# coding=utf8 | |
from gpt_index import SimpleDirectoryReader, GPTListIndex, GPTSimpleVectorIndex, LLMPredictor, PromptHelper | |
from langchain import OpenAI | |
import gradio as gr | |
import random | |
import time | |
import sys | |
import os | |
from transformers import pipeline | |
p = pipeline("automatic-speech-recognition") | |
os.environ["OPENAI_API_KEY"] = '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' | |
css = """ | |
.gradio-container { | |
background-color: #ffffff; | |
} | |
#component-2 {position: absolute; bottom: 0; width: 100%; | |
} | |
.app.svelte-ac4rv4>.main.svelte-ac4rv4 { | |
display: flex; | |
flex-grow: 1; | |
flex-direction: column; | |
background-image: url(https://i.ibb.co/3rVCQz0/background-GPT-1.png); | |
} | |
div.svelte-awbtu4 { | |
display: flex; | |
flex-direction: inherit; | |
flex-wrap: wrap; | |
gap: var(--form-gap-width); | |
box-shadow: var(--block-shadow); | |
border: var(--block-border-width) solid #5f0000; | |
border-radius: var(--radius-lg); | |
background: #ffffff; | |
overflow: hidden; | |
position: fixed; | |
bottom: 0; | |
margin-left: -16px; | |
} | |
.bot.svelte-6roggh.svelte-6roggh,.pending.svelte-6roggh.svelte-6roggh { | |
border-color: var(--border-color-primary); | |
background: #00adef; | |
color: white; | |
font-weight: bolder; | |
} | |
div.float.svelte-1frtwj3 { | |
position: absolute; | |
opacity: 0; | |
top: var(--block-label-margin); | |
left: var(--block-label-margin);} | |
.wrap.svelte-6roggh.svelte-6roggh { | |
padding: var(--block-padding); | |
height: 100%; | |
max-height: 100%; | |
overflow-y: auto; | |
} | |
div.user.svelte-6roggh.svelte-6roggh { | |
background: #0D1233; | |
color: white; | |
font-weight: bolder; | |
} | |
div.svelte-1frtwj3 { | |
display: inline-flex; | |
align-items: center; | |
z-index: var(--layer-2); | |
box-shadow: var(--block-shadow); | |
border: var(--block-label-border-width) solid #ffffff; | |
border-top: none; | |
border-left: none; | |
border-radius: var(--block-label-radius); | |
background: #eff6ff; | |
padding: var(--block-label-padding); | |
pointer-events: none; | |
color: var(--block-label-text-color); | |
font-weight: var(--block-label-text-weight); | |
width: 100%; | |
line-height: var(--line-sm); | |
} | |
div.bot.svelte-h.svelte-6roggh { | |
background: #199FDA; | |
color: white; | |
font-weight: bolder; | |
} | |
div.bot.svelte-17nzccn.svelte-17nzccn { | |
background: #199FDA; | |
} | |
div.user.svelte-6roggh.svelte-6roggh { | |
background: #0D1233; | |
} | |
div.user.svelte-17nzccn.svelte-17nzccn { | |
background: #0D1233; | |
} | |
div.textBoxBot { | |
display: flex; | |
flex-direction: inherit; | |
flex-wrap: wrap; | |
gap: var(--form-gap-width); | |
box-shadow: var(--block-shadow); | |
border: var(--block-border-width) solid #0D1233; | |
border-radius: var(--radius-lg); | |
background: #ffffff; | |
overflow: hidden; | |
position: fixed; | |
bottom: 0; | |
margin-left: -16px; | |
} | |
.textarea.svelte-1pie7s6.svelte-1pie7s6 { | |
display: flex; | |
flex-direction: inherit; | |
flex-wrap: wrap; | |
gap: var(--form-gap-width); | |
box-shadow: var(--block-shadow); | |
border: var(--block-border-width) solid #0D1233; | |
border-radius: var(--radius-lg); | |
background: #ffffff; | |
overflow: hidden; | |
position: fixed; | |
bottom: 0; | |
margin-left: -16px; | |
} | |
.svelte-1pie7s6.svelte-1pie7s6 { | |
display: flex; | |
flex-direction: inherit; | |
flex-wrap: wrap; | |
gap: var(--form-gap-width); | |
box-shadow: var(--block-shadow); | |
border: 5px solid #0D1233; | |
border-radius: var(--radius-lg); | |
border-color: #0D1233; | |
background: #ffffff; | |
color: #0D1233; | |
font-size: 16px; | |
overflow: hidden; | |
position: fixed; | |
bottom: 20px; /* Ajuste a distância vertical do rodapé */ | |
margin-left: -5px; | |
max-height: 80vh; /* Ajuste a altura máxima da div */ | |
max-width: 78%; /* Ajuste a largura máxima da div */ | |
} | |
.img.svelte-ms5bsk { | |
width: 100%; | |
height: 100%; | |
background-color: #ffffff; | |
border: 0px; | |
border-width: 0px; | |
} | |
.app.svelte-ac4rv4.svelte-ac4rv4 { | |
max-width: none; | |
background-color: #ffffff; | |
} | |
.app.svelte-ac4rv4.svelte-ac4rv4{max-width:none} | |
.wrap.svelte-1o68geq.svelte-1o68geq {max-height: none} | |
.block.svelte-mppz8v { | |
position: relative; | |
margin: 0; | |
box-shadow: var(--block-shadow); | |
border-width: var(--block-border-width); | |
border-color: #ffffff; | |
border-radius: var(--block-radius); | |
background: #ffffff; | |
width: 100%; | |
line-height: var(--line-sm); | |
} | |
""" | |
md = """This is some code: | |
hello | |
```py | |
def fn(x, y, z): | |
print(x, y, z) | |
""" | |
def transcribe(audio): | |
text = p(audio)["text"] | |
return text | |
def construct_index(directory_path): | |
max_input_size = 10000 | |
num_outputs = 10000 | |
max_chunk_overlap = 20000 | |
chunk_size_limit = 600000 | |
prompt_helper = PromptHelper(max_input_size, num_outputs, max_chunk_overlap, chunk_size_limit=chunk_size_limit) | |
llm_predictor = LLMPredictor(llm=OpenAI(temperature=0.0, model_name="gpt-3.5-turbo-instruct", max_tokens=num_outputs)) | |
documents = SimpleDirectoryReader(directory_path).load_data() | |
index = GPTSimpleVectorIndex.from_documents(documents) | |
index.save_to_disk('index.json') | |
return index | |
def chatbot(input_text): | |
index = GPTSimpleVectorIndex.load_from_disk('index.json') | |
response = index.query(input_text) | |
return str(response.response) | |
with gr.Blocks(css=css, elem_classes=".app.svelte-ac4rv4.svelte-ac4rv4") as demo: | |
realPath = str(os.path.dirname(os.path.realpath(__file__))) | |
img1 = gr.Image("images/imagem teste.png") | |
gpt = gr.Chatbot(label="Converse com o OM IA",elem_classes=".wrap.svelte-1o68geq.svelte-1o68geq", elem_id="chatbot").style(container=True) | |
msg = gr.Textbox(elem_id="div.svelte-awbtu4",elem_classes="div.svelte-awbtu4", show_label=False, | |
placeholder="Bem vindo a OM30, Em que posso ajudar?", | |
).style(container=True) | |
# clear = gr.Button("Limpar Conversa") | |
# sendAudio = gr.Button("Enviar Audio") | |
# sendAudio.click(gr.Audio(source="microphone", type="filepath",label="ESTÁ COM DIFICULDADES EM ESCREVER? CLIQUE E ME DIGA O QUE DESEJA")) | |
def respond(message, chat_history): | |
chat_history.append((message, chatbot(message))) | |
time.sleep(1) | |
vetor = [] | |
realPath = str(os.path.dirname(os.path.realpath(__file__))) | |
if str(message).upper()=="OLA" or str(message).upper()=="OLÁ" or str(message).upper()=="OI": | |
vetor = vetor + [ | |
((realPath + "\\images\\apresentacao.mp4",), "")] | |
else: | |
if str(message).upper() == "PROGRAMACAO DIA 20" \ | |
or str(message).upper() == "PROGRAMACAO DIA 20" \ | |
or str(message).upper() == "PROGRAMAÇÃO DIA 20" or str(message).upper() == "QUAL A PROGRAMACAO DIA 20?" \ | |
or str(message).upper() == "QUAL A PROGRAMAÇÃO DIA 20?" or str(message).upper() == "PROGRAMA DIA 20": | |
vetor = vetor + [((realPath + "\\images\\20-9-30.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\palestrantes20.mp4",), "")] | |
elif str(message).upper() == "AGENDA PARA O DIA 20" or str(message).upper() == "AGENDA PARA O DIA 20" or str(message).upper() == "QUAL A AGENDA DO DIA 20?": | |
vetor = vetor + [((realPath + "\\images\\20-9-30.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\palestrantes20.mp4",), "")] | |
elif str(message).upper() == "EVENTOS DO DIA 20" or str(message).upper() == "EVENTOS DO DIA 20" or str(message).upper() == "QUAIS OS EVENTOS DO DIA 20?": | |
vetor = vetor + [((realPath + "\\images\\20-9-30.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\palestrantes20.mp4",), "")] | |
elif str(message).upper() == "ATIVIDADES PROGRAMADAS PARA O DIA 20" or str(message).upper() == "ATIVIDADES PROGRAMADAS PARA O DIA 20" or str(message).upper() == "QUAIS AS ATIVIDADES PROGRAMADAS PARA O DIA 20?": | |
vetor = vetor + [((realPath + "\\images\\20-9-30.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\palestrantes20.mp4",), "")] | |
elif str(message).upper() == "CRONOGRAMA PARA O DIA 20" or str(message).upper() == "CRONOGRAMA PARA O DIA 20" or str(message).upper() == "QUAL O CRONOGRAMA PARA O DIA 20?": | |
vetor = vetor + [((realPath + "\\images\\20-9-30.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\palestrantes20.mp4",), "")] | |
elif str(message).upper() == "CALENDARIO PARA O DIA 20" or str(message).upper() == "CALENDARIO PARA O DIA 20" or str(message).upper() == "QUAL O CALENDARIO PARA O DIA 20?": | |
vetor = vetor + [((realPath + "\\images\\20-9-30.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\palestrantes20.mp4",), "")] | |
elif str(message).upper() == "DIA 20?" or str(message).upper() == "DIA 20": | |
vetor = vetor + [((realPath + "\\images\\20-9-30.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\palestrantes20.mp4",), "")] | |
elif str(message).upper() == "HORARIOS DO DIA 20" or str(message).upper() == "HORARIOS DO DIA 20" or str(message).upper() == "QUAIS OS HORARIOS DO DIA 20?": | |
vetor = vetor + [((realPath + "\\images\\20-9-30.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\palestrantes20.mp4",), "")] | |
elif str(message).upper() == "OQUE ESTÁ PLANEJADO PARA O DIA 20?" or str(message).upper() == "O QUE ESTÁ PLANEJADO PARA O DIA 20?": | |
vetor = vetor + [((realPath + "\\images\\20-9-30.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\palestrantes20.mp4",), "")] | |
elif str(message).upper() == "PLANOS PARA O DIA 20" or str(message).upper() == "PLANOS PARA O DIA 20" or str(message).upper() == "QUAIS OS PLANOS PARA O DIA 20?": | |
vetor = vetor + [((realPath + "\\images\\20-9-30.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\20-16-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\palestrantes20.mp4",), "")] | |
elif str(message).upper() == "PROGRAMACAO DIA 21" \ | |
or str(message).upper() == "PROGRAMACAO DIA 21" \ | |
or str(message).upper() == "PROGRAMAÇÃO DIA 21" or str(message).upper() == "QUAL A PROGRAMACAO DIA 21?" \ | |
or str(message).upper() == "QUAL A ROGRAMAÇÃO DIA 21?" or str(message).upper() == "PROGRAMA DIA 21" or str(message).upper() == "QUAL O PROGRAMA DIA 21?": | |
vetor = vetor + [((realPath + "\\images\\21-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-3.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-4.png",), "")] | |
elif str(message).upper() == "AGENDA PARA O DIA 21" or str(message).upper() == "AGENDA PARA O DIA 21" or str(message).upper() == "QUAL A AGENDA PARA O DIA 21?": | |
vetor = vetor + [((realPath + "\\images\\21-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-3.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-4.png",), "")] | |
elif str(message).upper() == "EVENTOS DO DIA 21" or str(message).upper() == "EVENTOS DO DIA 21" or str(message).upper() == "QUAIS OS EVENTOS DO DIA 21?": | |
vetor = vetor + [((realPath + "\\images\\21-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-3.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-4.png",), "")] | |
elif str(message).upper() == "ATIVIDADES PROGRAMADAS PARA O DIA 21" or str(message).upper() == "ATIVIDADES PROGRAMADAS PARA O DIA 21" or str(message).upper() == "QUAIS AS ATIVIDADES PROGRAMADAS PARA O DIA 21?": | |
vetor = vetor + [((realPath + "\\images\\21-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-3.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-4.png",), "")] | |
elif str(message).upper() == "CRONOGRAMA PARA O DIA 21" or str(message).upper() == "CRONOGRAMA PARA O DIA 21" or str(message).upper() == "QUAL O CRONOGRAMA PARA O DIA 21?": | |
vetor = vetor + [((realPath + "\\images\\21-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-3.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-4.png",), "")] | |
elif str(message).upper() == "CALENDARIO PARA O DIA 21" or str(message).upper() == "CALENDARIO PARA O DIA 21" or str(message).upper() == "QUAL O CALENDARIO PARA O DIA 21?": | |
vetor = vetor + [((realPath + "\\images\\21-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-3.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-4.png",), "")] | |
elif str(message).upper() == "DIA 21" or str(message).upper() == "DIA 21": | |
vetor = vetor + [((realPath + "\\images\\21-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-3.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-4.png",), "")] | |
elif str(message).upper() == "HORARIOS DO DIA 21" or str(message).upper() == "HORARIOS DO DIA 21" or str(message).upper() == "QUAIS OS HORARIOS DO DIA 21?": | |
vetor = vetor + [((realPath + "\\images\\21-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-3.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-4.png",), "")] | |
elif str(message).upper() == "OQUE ESTÁ PLANEJADO PARA O DIA 21?" or str(message).upper() == "O QUE ESTÁ PLANEJADO PARA O DIA 21?": | |
vetor = vetor + [((realPath + "\\images\\21-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-3.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-4.png",), "")] | |
elif str(message).upper() == "PLANOS PARA O DIA 21" or str(message).upper() == "PLANOS PARA O DIA 21" or str(message).upper() == "QUAIS OS PLANOS PARA O DIA 21?": | |
vetor = vetor + [((realPath + "\\images\\21-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-1.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-2.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-3.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\21-15-4.png",), "")] | |
elif str(message).upper() == "PROGRAMACAO DIA 22" \ | |
or str(message).upper() == "PROGRAMACAO DIA 22" \ | |
or str(message).upper() == "PROGRAMAÇÃO DIA 22" or str(message).upper() ==str(message).upper() == "QUAL A PROGRAMACAO DIA 22?" \ | |
or str(message).upper() == "QUAL A PROGRAMACAO DIA 22?" \ | |
or str(message).upper() == "QUAL A PROGRAMAÇÃO DIA 22?" or str(message).upper() == "PROGRAMA DIA 22": | |
vetor = vetor + [((realPath + "\\images\\22-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15-1.png",), "")] | |
elif str(message).upper() == "AGENDA PARA O DIA 22" or str(message).upper() == "AGENDA PARA O DIA 22" or str(message).upper() == "QUAL A AGENDA PARA O DIA 22?": | |
vetor = vetor + [((realPath + "\\images\\22-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15-1.png",), "")] | |
elif str(message).upper() == "EVENTOS DO DIA 22" or str(message).upper() == "EVENTOS DO DIA 22" or str(message).upper() == "QUAL OS EVENTOS DO DIA 22?": | |
vetor = vetor + [((realPath + "\\images\\22-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15-1.png",), "")] | |
elif str(message).upper() == "ATIVIDADES PROGRAMADAS PARA O DIA 22" or str(message).upper() == "ATIVIDADES PROGRAMADAS PARA O DIA 22" or str(message).upper() == "QUAIS AS ATIVIDADES PROGRAMADAS PARA O DIA 22?": | |
vetor = vetor + [((realPath + "\\images\\22-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15-1.png",), "")] | |
elif str(message).upper() == "CRONOGRAMA PARA O DIA 22" or str(message).upper() == "CRONOGRAMA PARA O DIA 22" or str(message).upper() == "QUAL O CRONOGRAMA PARA O DIA 22?": | |
vetor = vetor + [((realPath + "\\images\\22-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15-1.png",), "")] | |
elif str(message).upper() == "CALENDARIO PARA O DIA 22" or str(message).upper() == "CALENDARIO PARA O DIA 22" or str(message).upper() == "QUAL O CALENDARIO PARA O DIA 22?": | |
vetor = vetor + [((realPath + "\\images\\22-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15-1.png",), "")] | |
elif str(message).upper() == "DIA 22" or str(message).upper() == "DIA 22": | |
vetor = vetor + [((realPath + "\\images\\22-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15-1.png",), "")] | |
elif str(message).upper() == "HORARIOS DO DIA 22" or str(message).upper() == "HORARIOS DO DIA 22" or str(message).upper() == "QUAIS OS HORARIOS DO DIA 22?": | |
vetor = vetor + [((realPath + "\\images\\22-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15-1.png",), "")] | |
elif str(message).upper() == "O QUE ESTÁ PLANEJADO PARA O DIA 22" or str(message).upper() == "O QUE ESTÁ PLANEJADO PARA O DIA 22": | |
vetor = vetor + [((realPath + "\\images\\22-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15-1.png",), "")] | |
elif str(message).upper() == "PLANOS PARA O DIA 22" or str(message).upper() == "PLANOS PARA O DIA 22" or str(message).upper() == "QUAIS OS PLANOS PARA O DIA 22?": | |
vetor = vetor + [((realPath + "\\images\\22-9.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-10.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-11.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-14.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15.png",), "")] | |
vetor = vetor + [((realPath + "\\images\\22-15-1.png",), "")] | |
return "", chat_history+vetor | |
#clear.click(lambda:None, None, gpt, queue=False,) | |
msg.submit(respond, [msg, gpt], [msg,gpt]) | |
index = construct_index("docs") | |
demo.launch() | |