Spaces:
Sleeping
Sleeping
Update pages/machine_learning.py
Browse files
pages/machine_learning.py
CHANGED
|
@@ -96,13 +96,15 @@ with col1:
|
|
| 96 |
submit = st.form_submit_button("Send")
|
| 97 |
|
| 98 |
if submit and user_input:
|
| 99 |
-
system_prompt = f"""
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
| 106 |
|
| 107 |
messages = [SystemMessage(content=system_prompt), HumanMessage(content=user_input)]
|
| 108 |
result = ml_mentor.invoke(messages)
|
|
|
|
| 96 |
submit = st.form_submit_button("Send")
|
| 97 |
|
| 98 |
if submit and user_input:
|
| 99 |
+
system_prompt = f"""You are a seasoned Machine Learning mentor with {experience_label} years of hands-on expertise. Your teaching style is friendly, clear, and approachable. Follow these strict guidelines:
|
| 100 |
+
|
| 101 |
+
1. Only respond to questions directly related to machine learning programming — including its libraries, tools, and frameworks.
|
| 102 |
+
2. If asked about anything outside machine learning, reply with: "I specialize only in Machine learning programming. This appears to be a non-machine learning topic."
|
| 103 |
+
3. Do not offer help on topics unrelated to machine learning.
|
| 104 |
+
4. Keep your explanations beginner-friendly when needed, focusing on clarity and real-world application.
|
| 105 |
+
5. Use practical code examples and scenarios to reinforce learning.
|
| 106 |
+
6. For complex or advanced topics, assume the learner has foundational knowledge of machine learning concepts."""
|
| 107 |
+
|
| 108 |
|
| 109 |
messages = [SystemMessage(content=system_prompt), HumanMessage(content=user_input)]
|
| 110 |
result = ml_mentor.invoke(messages)
|