Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -114,10 +114,16 @@ class AtlasInferenceApp:
|
|
114 |
return "⚠️ Please select and load a model first"
|
115 |
|
116 |
try:
|
117 |
-
#
|
118 |
-
|
|
|
|
|
|
|
119 |
if not system_prompt:
|
120 |
-
|
|
|
|
|
|
|
121 |
|
122 |
# Add the system instruction to guide the model's behavior
|
123 |
prompt = f"{system_prompt}\n\n### Instruction:\n{message}\n\n### Response:"
|
|
|
114 |
return "⚠️ Please select and load a model first"
|
115 |
|
116 |
try:
|
117 |
+
# Debugging: Check if config and system_prompt exist
|
118 |
+
if "config" not in st.session_state.current_model:
|
119 |
+
return "⚠️ Model configuration not found. Please load the model again."
|
120 |
+
|
121 |
+
system_prompt = st.session_state.current_model["config"].get("system_prompt", "Default system prompt")
|
122 |
if not system_prompt:
|
123 |
+
system_prompt = "Default system prompt" # Fallback if system_prompt is None
|
124 |
+
|
125 |
+
# Debugging: Print the system prompt for verification
|
126 |
+
st.write(f"System Prompt: {system_prompt}")
|
127 |
|
128 |
# Add the system instruction to guide the model's behavior
|
129 |
prompt = f"{system_prompt}\n\n### Instruction:\n{message}\n\n### Response:"
|