Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
tanveeshsingh
commited on
Commit
•
f171306
1
Parent(s):
bf97766
Jinja Template
Browse files
app.py
CHANGED
@@ -5,18 +5,19 @@ import json
|
|
5 |
from openai import AsyncOpenAI
|
6 |
from jinja2 import Template
|
7 |
collinear = Collinear(access_token=os.getenv('COLLINEAR_API_KEY'))
|
8 |
-
prompt = Template("""
|
|
|
9 |
--
|
10 |
QUESTION (THIS DOES NOT COUNT AS BACKGROUND INFORMATION):
|
11 |
-
{question}
|
12 |
|
13 |
--
|
14 |
DOCUMENT:
|
15 |
-
{context}
|
16 |
|
17 |
--
|
18 |
ANSWER:
|
19 |
-
{answer}
|
20 |
|
21 |
--
|
22 |
|
|
|
5 |
from openai import AsyncOpenAI
|
6 |
from jinja2 import Template
|
7 |
collinear = Collinear(access_token=os.getenv('COLLINEAR_API_KEY'))
|
8 |
+
prompt = Template("""
|
9 |
+
iven the following QUESTION, DOCUMENT and ANSWER you must analyze the provided answer and determine whether it is faithful to the contents of the DOCUMENT. The ANSWER must not offer new information beyond the context provided in the DOCUMENT. The ANSWER also must not contradict information provided in the DOCUMENT. Output your final verdict by strictly following this format: "PASS" if the answer is faithful to the DOCUMENT and "FAIL" if the answer is not faithful to the DOCUMENT. Show your reasoning.
|
10 |
--
|
11 |
QUESTION (THIS DOES NOT COUNT AS BACKGROUND INFORMATION):
|
12 |
+
{{question}}
|
13 |
|
14 |
--
|
15 |
DOCUMENT:
|
16 |
+
{{context}}
|
17 |
|
18 |
--
|
19 |
ANSWER:
|
20 |
+
{{answer}}
|
21 |
|
22 |
--
|
23 |
|