Spaces:
Runtime error
Runtime error
changed system prompt
Browse files
app.py
CHANGED
@@ -9,16 +9,15 @@ from chainlit.playground.providers import ChatOpenAI # importing ChatOpenAI too
|
|
9 |
from dotenv import load_dotenv
|
10 |
from aimakerspace.text_utils import PDFFileLoader, CharacterTextSplitter
|
11 |
from aimakerspace.vectordatabase import VectorDatabase
|
12 |
-
import asyncio
|
13 |
|
14 |
load_dotenv()
|
15 |
|
16 |
# ChatOpenAI Templates
|
17 |
-
system_template = """You are
|
18 |
"""
|
19 |
|
20 |
user_template = """{input}
|
21 |
-
|
22 |
"""
|
23 |
|
24 |
assistant_template = """Use the following context, if any, to help you
|
@@ -28,6 +27,8 @@ CONTEXT:
|
|
28 |
===============
|
29 |
{context}
|
30 |
===============
|
|
|
|
|
31 |
"""
|
32 |
|
33 |
|
@@ -81,7 +82,7 @@ async def start_chat():
|
|
81 |
vector_db = await vector_db.abuild_from_list(chunks)
|
82 |
|
83 |
await cl.Message(
|
84 |
-
content="Done"
|
85 |
).send()
|
86 |
|
87 |
cl.user_session.set("vector_db", vector_db)
|
|
|
9 |
from dotenv import load_dotenv
|
10 |
from aimakerspace.text_utils import PDFFileLoader, CharacterTextSplitter
|
11 |
from aimakerspace.vectordatabase import VectorDatabase
|
|
|
12 |
|
13 |
load_dotenv()
|
14 |
|
15 |
# ChatOpenAI Templates
|
16 |
+
system_template = """You are a Wizzard and everything you say is a spell!
|
17 |
"""
|
18 |
|
19 |
user_template = """{input}
|
20 |
+
Wizzard, think through your response step by step.
|
21 |
"""
|
22 |
|
23 |
assistant_template = """Use the following context, if any, to help you
|
|
|
27 |
===============
|
28 |
{context}
|
29 |
===============
|
30 |
+
|
31 |
+
Spell away Wizzard!
|
32 |
"""
|
33 |
|
34 |
|
|
|
82 |
vector_db = await vector_db.abuild_from_list(chunks)
|
83 |
|
84 |
await cl.Message(
|
85 |
+
content="Done. Ask away!"
|
86 |
).send()
|
87 |
|
88 |
cl.user_session.set("vector_db", vector_db)
|