Spaces:
Running
Running
Update chatbot.py
Browse files- chatbot.py +8 -7
chatbot.py
CHANGED
|
@@ -41,7 +41,7 @@ pipe = load_model()
|
|
| 41 |
# ==================== CHAT INTERFACE ====================
|
| 42 |
st.title("IPTCHATBOT ASSISTANCE")
|
| 43 |
|
| 44 |
-
st.info("
|
| 45 |
|
| 46 |
if "messages" not in st.session_state:
|
| 47 |
st.session_state.messages = []
|
|
@@ -52,7 +52,7 @@ for message in st.session_state.messages:
|
|
| 52 |
|
| 53 |
# ... (model loading code above remains unchanged)
|
| 54 |
|
| 55 |
-
if prompt := st.chat_input("Ask about
|
| 56 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
| 57 |
with st.chat_message("user"):
|
| 58 |
st.markdown(prompt)
|
|
@@ -60,11 +60,12 @@ if prompt := st.chat_input("Ask about IPT, ICT, or anything..."):
|
|
| 60 |
with st.chat_message("assistant"):
|
| 61 |
with st.spinner("Thinking..."):
|
| 62 |
# Define the system prompt here
|
| 63 |
-
system_prompt = """
|
| 64 |
-
You are a
|
| 65 |
-
IPT means Industrial Practical Training (Industrial Attachment)
|
| 66 |
-
Always use this correct meaning
|
| 67 |
-
If
|
|
|
|
| 68 |
"""
|
| 69 |
|
| 70 |
# Build messages with system prompt first
|
|
|
|
| 41 |
# ==================== CHAT INTERFACE ====================
|
| 42 |
st.title("IPTCHATBOT ASSISTANCE")
|
| 43 |
|
| 44 |
+
st.info(" Answers may vary verify facts.")
|
| 45 |
|
| 46 |
if "messages" not in st.session_state:
|
| 47 |
st.session_state.messages = []
|
|
|
|
| 52 |
|
| 53 |
# ... (model loading code above remains unchanged)
|
| 54 |
|
| 55 |
+
if prompt := st.chat_input("Ask about Industrial Practical Training..."):
|
| 56 |
st.session_state.messages.append({"role": "user", "content": prompt})
|
| 57 |
with st.chat_message("user"):
|
| 58 |
st.markdown(prompt)
|
|
|
|
| 60 |
with st.chat_message("assistant"):
|
| 61 |
with st.spinner("Thinking..."):
|
| 62 |
# Define the system prompt here
|
| 63 |
+
system_prompt = system_prompt = """
|
| 64 |
+
You are a helpful assistant ONLY for questions about Industrial Practical Training (IPT) in Tanzania.
|
| 65 |
+
IPT means Industrial Practical Training (Industrial Attachment) a mandatory work placement for students to gain real-world experience.
|
| 66 |
+
Always use this correct meaning.
|
| 67 |
+
If the question is not about IPT, logbooks, reports, placement, or related topics, reply exactly:
|
| 68 |
+
"Sorry, I can only answer questions about Industrial Practical Training (IPT). Please ask something related."
|
| 69 |
"""
|
| 70 |
|
| 71 |
# Build messages with system prompt first
|