Spaces:
Runtime error
Runtime error
more files
Browse files
app.py
CHANGED
@@ -35,7 +35,7 @@ OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
|
|
35 |
|
36 |
def load_knowledgeBase():
|
37 |
embeddings=OpenAIEmbeddings(api_key=OPENAI_API_KEY)
|
38 |
-
DB_FAISS_PATH = "
|
39 |
db = FAISS.load_local(
|
40 |
DB_FAISS_PATH,
|
41 |
embeddings,
|
@@ -45,7 +45,7 @@ def load_knowledgeBase():
|
|
45 |
return db
|
46 |
def load_prompt():
|
47 |
prompt = """ You are helping students to pass NJMVC Knowledge Test. Provide a Single multiple choice question with 4 options to choose from.
|
48 |
-
Use the context to provide the question and answer choices.
|
49 |
context = {context}
|
50 |
question = {question}
|
51 |
if the answer is not in the pdf answer "i donot know what the hell you are asking about"
|
@@ -142,7 +142,7 @@ def main():
|
|
142 |
#st.session_state.conversation = get_conversation_chain(vector_store)
|
143 |
|
144 |
response=rag_chain.invoke(question)
|
145 |
-
st.write(
|
146 |
|
147 |
if __name__ == '__main__':
|
148 |
main()
|
|
|
35 |
|
36 |
def load_knowledgeBase():
|
37 |
embeddings=OpenAIEmbeddings(api_key=OPENAI_API_KEY)
|
38 |
+
DB_FAISS_PATH = "vectorstore/db_faiss/"
|
39 |
db = FAISS.load_local(
|
40 |
DB_FAISS_PATH,
|
41 |
embeddings,
|
|
|
45 |
return db
|
46 |
def load_prompt():
|
47 |
prompt = """ You are helping students to pass NJMVC Knowledge Test. Provide a Single multiple choice question with 4 options to choose from.
|
48 |
+
Use the information from context ONLY to provide the question and answer choices.
|
49 |
context = {context}
|
50 |
question = {question}
|
51 |
if the answer is not in the pdf answer "i donot know what the hell you are asking about"
|
|
|
142 |
#st.session_state.conversation = get_conversation_chain(vector_store)
|
143 |
|
144 |
response=rag_chain.invoke(question)
|
145 |
+
st.write(context)
|
146 |
|
147 |
if __name__ == '__main__':
|
148 |
main()
|