File size: 1,068 Bytes
18b77df
 
 
 
d60a7c1
 
 
18b77df
 
 
 
 
 
 
 
 
 
2e3ede1
18b77df
 
 
cc4cdc9
18b77df
cc4cdc9
18b77df
 
c3f61eb
 
 
 
 
18b77df
 
39e5a52
e430e67
2e33d61
18b77df
e430e67
18b77df
 
 
 
 
 
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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('https://33bbf3d5-c3fe-409d-a723-d22ea129e9a0.usrfiles.com/ugd/33bbf3_a21b940230be4adbb8be48927b9dc92b.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()