mmargg commited on
Commit
3ca09c9
·
verified ·
1 Parent(s): c9838b9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -10
app.py CHANGED
@@ -140,33 +140,26 @@ def respond(message,history):
140
 
141
  topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks)
142
  print(topic_chunks)
143
- information = get_top_chunks(message, chunk_embeddings, cleaned_chunks),"/n".join(topic_chunks)
144
- messages = [{"role": "assistant", "content": f"You are a friendly, helpful chatbot that gives academic advice to disadvantaged students about their education based on their question. You only answer in complete sentences with correct grammar, punctuation, and complete ideas. When you give advice, keep in mind the following information {information}"}]
145
-
146
 
147
  elif chatbot_topic=="Extracurriculars":
148
  topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks2)
149
  print(topic_chunks)
150
- information = get_top_chunks(message, chunk_embeddings, cleaned_chunks2),"/n".join(topic_chunks)
151
- messages = [{"role": "assistant", "content": f"You are a friendly, helpful chatbot that gives academic advice to disadvantaged students about their education based on their question. You only answer in complete sentences with correct grammar, punctuation, and complete ideas. When you give advice, keep in mind the following information {information}"}]
152
 
153
 
154
  elif chatbot_topic=="Time Management":
155
  topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks3)
156
  print(topic_chunks)
157
- information = get_top_chunks(message, chunk_embeddings, cleaned_chunks3),"/n".join(topic_chunks)
158
- messages = [{"role": "assistant", "content": f"You are a friendly, helpful chatbot that gives academic advice to disadvantaged students about their education based on their question. You only answer in complete sentences with correct grammar, punctuation, and complete ideas. When you give advice, keep in mind the following information {information}"}]
159
 
160
 
161
  elif chatbot_topic=="Financial Aid":
162
  topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks4)
163
  print(topic_chunks)
164
- information = get_top_chunks(message, chunk_embeddings, cleaned_chunks4),"/n".join(topic_chunks)
165
- messages = [{"role": "assistant", "content": f"You are a friendly, helpful chatbot that gives academic advice to disadvantaged students about their education based on their question. You only answer in complete sentences with correct grammar, punctuation, and complete ideas. When you give advice, keep in mind the following information {information}"}]
166
-
167
  #return information
168
  #return topic_chunks
169
 
 
170
 
171
  if history:
172
  messages.extend(history) #keep adding history
 
140
 
141
  topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks)
142
  print(topic_chunks)
 
 
 
143
 
144
  elif chatbot_topic=="Extracurriculars":
145
  topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks2)
146
  print(topic_chunks)
 
 
147
 
148
 
149
  elif chatbot_topic=="Time Management":
150
  topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks3)
151
  print(topic_chunks)
 
 
152
 
153
 
154
  elif chatbot_topic=="Financial Aid":
155
  topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks4)
156
  print(topic_chunks)
157
+
158
+ information="\n".join(topic_chunks)
 
159
  #return information
160
  #return topic_chunks
161
 
162
+ messages = [{"role": "assistant", "content": f"You are a friendly, helpful chatbot that gives academic advice to disadvantaged students about their education based on their question. You only answer in complete sentences with correct grammar, punctuation, and complete ideas. When you give advice, keep in mind the following information {information}"}]
163
 
164
  if history:
165
  messages.extend(history) #keep adding history