Spaces:
Runtime error
Runtime error
add jinja2 template download
Browse files
app.py
CHANGED
|
@@ -184,6 +184,13 @@ if st.session_state['tokenizer_json'] is not None:
|
|
| 184 |
mime='application/json',
|
| 185 |
use_container_width=True
|
| 186 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 187 |
if push_to_hub_button:
|
| 188 |
with open(f"./tmp/{st.session_state['uuid']}/tmp_chat_template.json", "w") as fp:
|
| 189 |
fp.write(st.session_state['successful_template'])
|
|
|
|
| 184 |
mime='application/json',
|
| 185 |
use_container_width=True
|
| 186 |
)
|
| 187 |
+
st.download_button(
|
| 188 |
+
label="Download chat_template.jinja2",
|
| 189 |
+
data=st.session_state['successful_template'],
|
| 190 |
+
file_name='chat_template.jinja2',
|
| 191 |
+
mime='text/plain',
|
| 192 |
+
use_container_width=True
|
| 193 |
+
)
|
| 194 |
if push_to_hub_button:
|
| 195 |
with open(f"./tmp/{st.session_state['uuid']}/tmp_chat_template.json", "w") as fp:
|
| 196 |
fp.write(st.session_state['successful_template'])
|