Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -12,10 +12,7 @@ from dotenv import load_dotenv
|
|
12 |
import openai
|
13 |
|
14 |
load_dotenv()
|
15 |
-
|
16 |
-
# api_key = os.getenv('OPENAI_API_KEY') ## .env ํ์ผ ์
๋ก๋ํ๋ฉด ์จ๊ฒจ์ง์ง ์์ ์๋จ
|
17 |
-
# api_key = os.environ['my_secret'] ## ์๋ถ๋ฌ์์ง
|
18 |
-
# api_key = os.getenv('my_secret') ## 3ํธ .env ๋์ secretํค๋ฅผ ๋ถ๋ฌ์ค๋ ํํ๋ก ๋์
|
19 |
os.environ["OPENAI_API_KEY"] = os.environ['my_secret']
|
20 |
|
21 |
loader = PyPDFLoader("/home/user/app/docs.pdf")
|
@@ -46,7 +43,7 @@ from langchain.prompts.chat import (
|
|
46 |
HumanMessagePromptTemplate,
|
47 |
)
|
48 |
|
49 |
-
system_template="""Use the following pieces of context to answer the users question shortly.
|
50 |
Given the following summaries of a long document and a question, create a final answer with references ("SOURCES"), use "SOURCES" in capital letters regardless of the number of sources.
|
51 |
If you don't know the answer, just say that "I don't know", don't try to make up an answer.
|
52 |
----------------
|
|
|
12 |
import openai
|
13 |
|
14 |
load_dotenv()
|
15 |
+
|
|
|
|
|
|
|
16 |
os.environ["OPENAI_API_KEY"] = os.environ['my_secret']
|
17 |
|
18 |
loader = PyPDFLoader("/home/user/app/docs.pdf")
|
|
|
43 |
HumanMessagePromptTemplate,
|
44 |
)
|
45 |
|
46 |
+
system_template="""You are a chatbot dealing with complainants.Use the following pieces of context to answer the users question shortly.
|
47 |
Given the following summaries of a long document and a question, create a final answer with references ("SOURCES"), use "SOURCES" in capital letters regardless of the number of sources.
|
48 |
If you don't know the answer, just say that "I don't know", don't try to make up an answer.
|
49 |
----------------
|