File size: 1,134 Bytes
7fea1f4
 
 
 
de09bee
7fea1f4
 
 
 
 
 
de09bee
7fea1f4
56edb3a
988c713
 
 
de09bee
7fea1f4
 
 
de09bee
7fea1f4
 
de09bee
180d44d
7fea1f4
de09bee
7fea1f4
 
988c713
7fea1f4
de09bee
4068dda
de09bee
7fea1f4
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
import pandas as pd
import os
from langchain.llms import OpenAI
import chromadb

from config import *
from src.control.control import Controller
from src.tools.retriever import Retriever
from src.tools.llm import LlmAgent
from src.model.doc import Doc
import src.view.view as view

os.environ["TOKENIZERS_PARALLELISM"] = "true"

if not "OPENAI_API_KEY" in os.environ:
    from config_key import OPENAI_API_KEY
    os.environ['OPENAI_API_KEY'] = OPENAI_API_KEY

doc_content = Doc(content_en_path)
doc_plan = Doc(plan_path)
doc_content_fr = Doc(content_fr_path)

client_db = chromadb.Client()
retriever = Retriever(client_db, doc_plan, doc_content, doc_content_fr, collection_name)

llm_model = OpenAI(temperature=0)
llm = LlmAgent(llm_model)

specials['remote_rate_df'] = pd.read_csv(specials['remote_rate_path'])
specials['accommodation_meal_df'] = pd.read_csv(specials['accommodation_meal_path'])
controller = Controller(retriever=retriever, llm=llm, content_language=content_language, plan_language=plan_language,
                        specials=specials)

qna = view.run(ctrl=controller, config=view_config)

qna.queue().launch()