Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -120,7 +120,9 @@ def respond(message, history):
|
|
| 120 |
top_cool_results = get_top_chunks(message, cool_chunk_embeddings, cleaned_cool_chunks) # Complete this line
|
| 121 |
top_tutor_results = get_top_chunks(message, tutor_chunk_embeddings, cleaned_tutor_chunks)
|
| 122 |
top_strict_results = get_top_chunks(message, strict_chunk_embeddings, cleaned_strict_chunks)
|
|
|
|
| 123 |
str_chunks = "\n".join(best_chunks)
|
|
|
|
| 124 |
messages = [{"role": "system", "content": f"You are chatbot that plays the role of the user's mom. Base your response on the provided context: {str_chunks}"},
|
| 125 |
{"role": "user",
|
| 126 |
"content": (
|
|
@@ -141,4 +143,4 @@ def respond(message, history):
|
|
| 141 |
return response['choices'][0]['message']['content'].strip()
|
| 142 |
|
| 143 |
chatbot = gr.ChatInterface(respond, type = 'messages')
|
| 144 |
-
chatbot.launch()
|
|
|
|
| 120 |
top_cool_results = get_top_chunks(message, cool_chunk_embeddings, cleaned_cool_chunks) # Complete this line
|
| 121 |
top_tutor_results = get_top_chunks(message, tutor_chunk_embeddings, cleaned_tutor_chunks)
|
| 122 |
top_strict_results = get_top_chunks(message, strict_chunk_embeddings, cleaned_strict_chunks)
|
| 123 |
+
|
| 124 |
str_chunks = "\n".join(best_chunks)
|
| 125 |
+
|
| 126 |
messages = [{"role": "system", "content": f"You are chatbot that plays the role of the user's mom. Base your response on the provided context: {str_chunks}"},
|
| 127 |
{"role": "user",
|
| 128 |
"content": (
|
|
|
|
| 143 |
return response['choices'][0]['message']['content'].strip()
|
| 144 |
|
| 145 |
chatbot = gr.ChatInterface(respond, type = 'messages')
|
| 146 |
+
chatbot.launch()
|