Juridiquebot / app.py
Docfile's picture
Update app.py
cc4cdc9 verified
raw
history blame
1.03 kB
import os
from embedchain import Pipeline as App
import gradio as gr
token=os.environ.get("TOKEN")
os.environ["GOOGLE_API_KEY"] = token
app = App.from_config(config={
"llm": {
"provider": "google",
"config": {
"model": "gemini-pro",
"temperature": 0.5,
"max_tokens": 1000,
"top_p": 1,
"stream": False,
},
},
"embedder": {
"provider": "huggingface",
"config": {
"model": "hkunlp/instructor-large",
},
},
"chunker": {
"chunk_size": 2000,
"chunk_overlap": 0,
"length_function": "len",
},
})
app.add('http://www.droit-afrique.com/uploads/Gabon-Code-2019-penal.pdf', data_type='pdf_file')
link = "https://youtu.be/PbX2t2bEgxg?si=-iK6g9uAhYEE-zU3"
#app.add("https://youtu.be/PbX2t2bEgxg?si=-iK6g9uAhYEE-zU3",data_type="youtube_video")
def query(message, history):
return app.chat(message)
demo = gr.ChatInterface(query)
demo.launch()