Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -141,28 +141,32 @@ def respond(message,history):
|
|
| 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 |
|
| 145 |
elif chatbot_topic=="Extracurriculars":
|
| 146 |
topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks2)
|
| 147 |
print(topic_chunks)
|
| 148 |
information = get_top_chunks(message, chunk_embeddings, cleaned_chunks2),"/n".join(topic_chunks)
|
|
|
|
| 149 |
|
| 150 |
|
| 151 |
elif chatbot_topic=="Time Management":
|
| 152 |
topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks3)
|
| 153 |
print(topic_chunks)
|
| 154 |
information = get_top_chunks(message, chunk_embeddings, cleaned_chunks3),"/n".join(topic_chunks)
|
|
|
|
| 155 |
|
| 156 |
|
| 157 |
elif chatbot_topic=="Financial Aid":
|
| 158 |
topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks4)
|
| 159 |
print(topic_chunks)
|
| 160 |
information = get_top_chunks(message, chunk_embeddings, cleaned_chunks4),"/n".join(topic_chunks)
|
|
|
|
| 161 |
|
| 162 |
#return information
|
| 163 |
#return topic_chunks
|
| 164 |
|
| 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 {topic_chunks}"}]
|
| 166 |
|
| 167 |
if history:
|
| 168 |
messages.extend(history) #keep adding history
|
|
|
|
| 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
|