Spaces:
Sleeping
Sleeping
cleaning my code
Browse files
app.py
CHANGED
|
@@ -81,30 +81,6 @@ avatar_img = "images/UH.png" # Avatar shown beside bot messages
|
|
| 81 |
logo = "images/UH Crest.png" # Crest image
|
| 82 |
|
| 83 |
# # === Chat Logic with Course Memory ===
|
| 84 |
-
# def chat_with_bot(message, history, course_state):
|
| 85 |
-
# lower_msg = message.lower()
|
| 86 |
-
|
| 87 |
-
# if "msc" in lower_msg or "course:" in lower_msg:
|
| 88 |
-
# course_state = message.strip()
|
| 89 |
-
# response = f"✅ Got it! You're now asking about: **{course_state}**"
|
| 90 |
-
# elif "change course to" in lower_msg:
|
| 91 |
-
# course_state = message.replace("change course to", "").strip()
|
| 92 |
-
# response = f"🔁 Course changed. Now answering based on: **{course_state}**"
|
| 93 |
-
# elif course_state:
|
| 94 |
-
# full_query = f"For the course '{course_state}': {message}"
|
| 95 |
-
# raw_output = qa_chain.run(full_query)
|
| 96 |
-
# response = raw_output.split("Answer:")[-1].strip()
|
| 97 |
-
|
| 98 |
-
# # Clean LLM artifacts
|
| 99 |
-
# response = response.replace("<|assistant|>", "").strip()
|
| 100 |
-
# else:
|
| 101 |
-
# response = "⚠️ Please first mention the course you're asking about (e.g., 'MSc Data Science')."
|
| 102 |
-
|
| 103 |
-
# history.append((message, response))
|
| 104 |
-
# return "", history, course_state
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
def chat_with_bot(message, history, course_state):
|
| 109 |
lower_msg = message.lower()
|
| 110 |
|
|
|
|
| 81 |
logo = "images/UH Crest.png" # Crest image
|
| 82 |
|
| 83 |
# # === Chat Logic with Course Memory ===
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
def chat_with_bot(message, history, course_state):
|
| 85 |
lower_msg = message.lower()
|
| 86 |
|