Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -134,8 +134,6 @@ client= InferenceClient("openai/gpt-oss-20b")
|
|
| 134 |
#defining role of AI and user
|
| 135 |
|
| 136 |
def respond(message,history):
|
| 137 |
-
topic_chunks=[]
|
| 138 |
-
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}"}]
|
| 139 |
topic_chunks=[]
|
| 140 |
if chatbot_topic=="Academia":
|
| 141 |
|
|
@@ -159,6 +157,8 @@ def respond(message,history):
|
|
| 159 |
topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks4)
|
| 160 |
print(topic_chunks)
|
| 161 |
information = get_top_chunks(message, chunk_embeddings, cleaned_chunks4),"/n".join(topic_chunks)
|
|
|
|
|
|
|
| 162 |
|
| 163 |
|
| 164 |
if history:
|
|
|
|
| 134 |
#defining role of AI and user
|
| 135 |
|
| 136 |
def respond(message,history):
|
|
|
|
|
|
|
| 137 |
topic_chunks=[]
|
| 138 |
if chatbot_topic=="Academia":
|
| 139 |
|
|
|
|
| 157 |
topic_chunks=get_top_chunks(message, chunk_embeddings, cleaned_chunks4)
|
| 158 |
print(topic_chunks)
|
| 159 |
information = get_top_chunks(message, chunk_embeddings, cleaned_chunks4),"/n".join(topic_chunks)
|
| 160 |
+
|
| 161 |
+
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}"}]
|
| 162 |
|
| 163 |
|
| 164 |
if history:
|