Spaces:
Running
Running
Commit
·
d9f8a09
1
Parent(s):
3d2a012
file upload gallery
Browse files
app.py
CHANGED
|
@@ -721,7 +721,7 @@ def save_prompt_yaml(filename, col_right_save):
|
|
| 721 |
filepath = os.path.join(dir_prompt, f"{filename}.yaml")
|
| 722 |
|
| 723 |
with open(filepath, 'w') as file:
|
| 724 |
-
yaml.safe_dump(yaml_content, file)
|
| 725 |
|
| 726 |
st.success(f"Prompt saved as '{filename}.yaml'.")
|
| 727 |
|
|
@@ -1163,17 +1163,17 @@ The desired null value is also given. Populate the field with the null value of
|
|
| 1163 |
|
| 1164 |
with col_prompt_main_right:
|
| 1165 |
if st.session_state['user_clicked_load_prompt_yaml'] is None: # see if user has loaded a yaml to edit
|
| 1166 |
-
st.session_state['show_prompt_name_e'] = f"Prompt Status
|
| 1167 |
if st.session_state['new_prompt_yaml_filename']:
|
| 1168 |
-
st.session_state['show_prompt_name_w'] = f"New Prompt Name
|
| 1169 |
else:
|
| 1170 |
-
st.session_state['show_prompt_name_w'] = f"New Prompt Name
|
| 1171 |
else:
|
| 1172 |
-
st.session_state['show_prompt_name_e'] = f"Prompt Status: Editing
|
| 1173 |
if st.session_state['new_prompt_yaml_filename']:
|
| 1174 |
-
st.session_state['show_prompt_name_w'] = f"New Prompt Name
|
| 1175 |
else:
|
| 1176 |
-
st.session_state['show_prompt_name_w'] = f"New Prompt Name
|
| 1177 |
|
| 1178 |
st.subheader(f'Full Prompt')
|
| 1179 |
st.write(st.session_state['show_prompt_name_e'])
|
|
@@ -1190,10 +1190,6 @@ The desired null value is also given. Populate the field with the null value of
|
|
| 1190 |
'mapping': st.session_state['mapping'],
|
| 1191 |
}
|
| 1192 |
st.json(st.session_state['prompt_info'])
|
| 1193 |
-
|
| 1194 |
-
def save_yaml(content, filename="rules_config.yaml"):
|
| 1195 |
-
with open(filename, 'w') as file:
|
| 1196 |
-
yaml.dump(content, file)
|
| 1197 |
|
| 1198 |
def show_header_welcome():
|
| 1199 |
st.session_state.logo_path = os.path.join(st.session_state.dir_home, 'img','logo.png')
|
|
|
|
| 721 |
filepath = os.path.join(dir_prompt, f"{filename}.yaml")
|
| 722 |
|
| 723 |
with open(filepath, 'w') as file:
|
| 724 |
+
yaml.safe_dump(dict(yaml_content), file, sort_keys=False)
|
| 725 |
|
| 726 |
st.success(f"Prompt saved as '{filename}.yaml'.")
|
| 727 |
|
|
|
|
| 1163 |
|
| 1164 |
with col_prompt_main_right:
|
| 1165 |
if st.session_state['user_clicked_load_prompt_yaml'] is None: # see if user has loaded a yaml to edit
|
| 1166 |
+
st.session_state['show_prompt_name_e'] = f"Prompt Status :arrow_forward: Building prompt from scratch"
|
| 1167 |
if st.session_state['new_prompt_yaml_filename']:
|
| 1168 |
+
st.session_state['show_prompt_name_w'] = f"New Prompt Name :arrow_forward: {st.session_state['new_prompt_yaml_filename']}.yaml"
|
| 1169 |
else:
|
| 1170 |
+
st.session_state['show_prompt_name_w'] = f"New Prompt Name :arrow_forward: [PLEASE SET NAME]"
|
| 1171 |
else:
|
| 1172 |
+
st.session_state['show_prompt_name_e'] = f"Prompt Status: Editing :arrow_forward: {st.session_state['selected_yaml_file']}"
|
| 1173 |
if st.session_state['new_prompt_yaml_filename']:
|
| 1174 |
+
st.session_state['show_prompt_name_w'] = f"New Prompt Name :arrow_forward: {st.session_state['new_prompt_yaml_filename']}.yaml"
|
| 1175 |
else:
|
| 1176 |
+
st.session_state['show_prompt_name_w'] = f"New Prompt Name :arrow_forward: [PLEASE SET NAME]"
|
| 1177 |
|
| 1178 |
st.subheader(f'Full Prompt')
|
| 1179 |
st.write(st.session_state['show_prompt_name_e'])
|
|
|
|
| 1190 |
'mapping': st.session_state['mapping'],
|
| 1191 |
}
|
| 1192 |
st.json(st.session_state['prompt_info'])
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1193 |
|
| 1194 |
def show_header_welcome():
|
| 1195 |
st.session_state.logo_path = os.path.join(st.session_state.dir_home, 'img','logo.png')
|