mohammed3536 commited on
Commit
45889c6
1 Parent(s): a0c026c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -69,12 +69,8 @@ def generate_quiz(quiz_name, quiz_topic, num_questions, pdf_content):
69
  prompt = PromptTemplate(template=template, input_variables=['chat_history','human_input','name','context'])
70
 
71
 
72
- # Get the vector from the prompt
73
- vector = st.session_state.vectorDB.embed(prompt.generate())
74
-
75
- # Add the vector to the FAISS index
76
- st.session_state.vectorDB.index([vector])
77
-
78
 
79
  # Save button to store vector database
80
  if st.session_state.vectorDB:
@@ -95,3 +91,4 @@ if __name__ =='__main__':
95
  # Generate quiz if all inputs are provided
96
  if quiz_name and quiz_topic and num_questions and pdf_content:
97
  generate_quiz(quiz_name, quiz_topic, num_questions, pdf_content)
 
 
69
  prompt = PromptTemplate(template=template, input_variables=['chat_history','human_input','name','context'])
70
 
71
 
72
+ # Store question data in vector database
73
+ st.session_state.vectorDB.add(prompt.generate(), embedding=None)
 
 
 
 
74
 
75
  # Save button to store vector database
76
  if st.session_state.vectorDB:
 
91
  # Generate quiz if all inputs are provided
92
  if quiz_name and quiz_topic and num_questions and pdf_content:
93
  generate_quiz(quiz_name, quiz_topic, num_questions, pdf_content)
94
+