Spaces:
Running
Running
Nils Durner
commited on
Commit
·
1ead00b
1
Parent(s):
a548675
backwards compat
Browse files
app.py
CHANGED
@@ -113,10 +113,15 @@ def import_history(history, file):
|
|
113 |
# Deserialize the JSON content
|
114 |
import_data = json.loads(content)
|
115 |
|
116 |
-
|
117 |
-
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
-
return
|
120 |
|
121 |
with gr.Blocks() as demo:
|
122 |
gr.Markdown("# Amazon™️ Bedrock™️ Chat™️ (Nils' Version™️) feat. Mistral™️ AI & Anthropic™️ Claude™️")
|
|
|
113 |
# Deserialize the JSON content
|
114 |
import_data = json.loads(content)
|
115 |
|
116 |
+
# Check if 'history' key exists for backward compatibility
|
117 |
+
if 'history' in import_data:
|
118 |
+
history = import_data['history']
|
119 |
+
system_prompt.value = import_data.get('system_prompt', '') # Set default if not present
|
120 |
+
else:
|
121 |
+
# Assume it's an old format with only history data
|
122 |
+
history = import_data
|
123 |
|
124 |
+
return history, system_prompt.value # Return system prompt value to be set in the UI
|
125 |
|
126 |
with gr.Blocks() as demo:
|
127 |
gr.Markdown("# Amazon™️ Bedrock™️ Chat™️ (Nils' Version™️) feat. Mistral™️ AI & Anthropic™️ Claude™️")
|