Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -24,9 +24,9 @@ def chat_with_model(prompts):
|
|
24 |
return response['choices'][0]['message']['content']
|
25 |
|
26 |
def generate_filename(prompt):
|
27 |
-
safe_date_time = datetime.now().strftime("%
|
28 |
-
safe_prompt = "".join(x for x in prompt if x.isalnum())[:
|
29 |
-
return f"{safe_date_time}_{safe_prompt}.
|
30 |
|
31 |
def create_file(filename, prompt, response):
|
32 |
with open(filename, 'w') as file:
|
@@ -93,7 +93,7 @@ def main():
|
|
93 |
|
94 |
st.sidebar.markdown(get_table_download_link(filename), unsafe_allow_html=True)
|
95 |
|
96 |
-
htm_files = glob.glob("*.
|
97 |
for file in htm_files:
|
98 |
st.sidebar.markdown(get_table_download_link(file), unsafe_allow_html=True)
|
99 |
|
|
|
24 |
return response['choices'][0]['message']['content']
|
25 |
|
26 |
def generate_filename(prompt):
|
27 |
+
safe_date_time = datetime.now().strftime("%m%d_%H%M")
|
28 |
+
safe_prompt = "".join(x for x in prompt if x.isalnum())[:30]
|
29 |
+
return f"{safe_date_time}_{safe_prompt}.txt"
|
30 |
|
31 |
def create_file(filename, prompt, response):
|
32 |
with open(filename, 'w') as file:
|
|
|
93 |
|
94 |
st.sidebar.markdown(get_table_download_link(filename), unsafe_allow_html=True)
|
95 |
|
96 |
+
htm_files = glob.glob("*.txt")
|
97 |
for file in htm_files:
|
98 |
st.sidebar.markdown(get_table_download_link(file), unsafe_allow_html=True)
|
99 |
|