Spaces:
Running
Running
Commit
·
6275f78
1
Parent(s):
ce5b499
file upload gallery
Browse files
app.py
CHANGED
|
@@ -929,6 +929,13 @@ The desired null value is also given. Populate the field with the null value of
|
|
| 929 |
st.session_state['prompt_description'] = st.text_input("Enter description of prompt", value=st.session_state['prompt_info'].get('prompt_description', st.session_state['default_prompt_description']))
|
| 930 |
|
| 931 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 932 |
st.write('---')
|
| 933 |
st.header("Set LLM Model Type")
|
| 934 |
# Define the options for the dropdown
|
|
@@ -1130,12 +1137,9 @@ The desired null value is also given. Populate the field with the null value of
|
|
| 1130 |
|
| 1131 |
st.write('---')
|
| 1132 |
st.header("Save and Download Custom Prompt")
|
| 1133 |
-
st.write('Provide a name for your custom prompt. It can only conatin letters, numbers, and underscores.')
|
| 1134 |
st.write('Once you click save, validation checks will verify the formatting and then a download button will appear so that you can ***save a local copy of your custom prompt.***')
|
| 1135 |
col_left_save, col_right_save, _ = st.columns([2,2,8])
|
| 1136 |
with col_left_save:
|
| 1137 |
-
# Input for new file name
|
| 1138 |
-
st.session_state['new_prompt_yaml_filename'] = st.text_input("Enter filename to save your prompt as a configuration YAML:",placeholder='my_prompt_name')
|
| 1139 |
# Button to save the new YAML file
|
| 1140 |
if st.button('Save YAML', type='primary'):
|
| 1141 |
if st.session_state['new_prompt_yaml_filename']:
|
|
@@ -1157,12 +1161,16 @@ The desired null value is also given. Populate the field with the null value of
|
|
| 1157 |
st.rerun()
|
| 1158 |
|
| 1159 |
with col_prompt_main_right:
|
| 1160 |
-
|
| 1161 |
-
|
| 1162 |
-
|
| 1163 |
else:
|
| 1164 |
-
|
| 1165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1166 |
st.session_state['prompt_info'] = {
|
| 1167 |
'prompt_author': st.session_state['prompt_author'],
|
| 1168 |
'prompt_author_institution': st.session_state['prompt_author_institution'],
|
|
@@ -1670,6 +1678,10 @@ if 'selected_yaml_file' not in st.session_state:
|
|
| 1670 |
st.session_state['selected_yaml_file'] = None
|
| 1671 |
if 'new_prompt_yaml_filename' not in st.session_state:
|
| 1672 |
st.session_state['new_prompt_yaml_filename'] = None
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1673 |
|
| 1674 |
|
| 1675 |
# if not st.session_state.private_file:
|
|
|
|
| 929 |
st.session_state['prompt_description'] = st.text_input("Enter description of prompt", value=st.session_state['prompt_info'].get('prompt_description', st.session_state['default_prompt_description']))
|
| 930 |
|
| 931 |
|
| 932 |
+
st.write('---')
|
| 933 |
+
# Input for new file name
|
| 934 |
+
st.header("Prompt Name")
|
| 935 |
+
st.write('Provide a name for your custom prompt. It can only conatin letters, numbers, and underscores. No spaces, dashes, or special characters.')
|
| 936 |
+
st.session_state['new_prompt_yaml_filename'] = st.text_input("Enter filename to save your prompt as a configuration YAML:", value=None, placeholder='my_prompt_name')
|
| 937 |
+
|
| 938 |
+
|
| 939 |
st.write('---')
|
| 940 |
st.header("Set LLM Model Type")
|
| 941 |
# Define the options for the dropdown
|
|
|
|
| 1137 |
|
| 1138 |
st.write('---')
|
| 1139 |
st.header("Save and Download Custom Prompt")
|
|
|
|
| 1140 |
st.write('Once you click save, validation checks will verify the formatting and then a download button will appear so that you can ***save a local copy of your custom prompt.***')
|
| 1141 |
col_left_save, col_right_save, _ = st.columns([2,2,8])
|
| 1142 |
with col_left_save:
|
|
|
|
|
|
|
| 1143 |
# Button to save the new YAML file
|
| 1144 |
if st.button('Save YAML', type='primary'):
|
| 1145 |
if st.session_state['new_prompt_yaml_filename']:
|
|
|
|
| 1161 |
st.rerun()
|
| 1162 |
|
| 1163 |
with col_prompt_main_right:
|
| 1164 |
+
if st.session_state['new_prompt_yaml_filename']:
|
| 1165 |
+
st.session_state['show_prompt_name_e'] = f"Editing --> {st.session_state['selected_yaml_file']}"
|
| 1166 |
+
st.session_state['show_prompt_name_w'] = f"Will be saved as --> {st.session_state['new_prompt_yaml_filename']}.yaml"
|
| 1167 |
else:
|
| 1168 |
+
st.session_state['show_prompt_name_e'] = f"Editing --> {st.session_state['selected_yaml_file']}"
|
| 1169 |
+
st.session_state['show_prompt_name_w'] = f"Please set name"
|
| 1170 |
+
|
| 1171 |
+
st.subheader(f'Full Prompt')
|
| 1172 |
+
st.write(st.session_state['show_prompt_name_e'])
|
| 1173 |
+
st.write(st.session_state['show_prompt_name_w'])
|
| 1174 |
st.session_state['prompt_info'] = {
|
| 1175 |
'prompt_author': st.session_state['prompt_author'],
|
| 1176 |
'prompt_author_institution': st.session_state['prompt_author_institution'],
|
|
|
|
| 1678 |
st.session_state['selected_yaml_file'] = None
|
| 1679 |
if 'new_prompt_yaml_filename' not in st.session_state:
|
| 1680 |
st.session_state['new_prompt_yaml_filename'] = None
|
| 1681 |
+
if 'show_prompt_name_e' not in st.session_state:
|
| 1682 |
+
st.session_state['show_prompt_name_e'] = None
|
| 1683 |
+
if 'show_prompt_name_w' not in st.session_state:
|
| 1684 |
+
st.session_state['show_prompt_name_w'] = None
|
| 1685 |
|
| 1686 |
|
| 1687 |
# if not st.session_state.private_file:
|