Update app.py
Browse files
app.py
CHANGED
@@ -153,12 +153,13 @@ def create_file(prompt, response, file_type="md"):
|
|
153 |
return filename
|
154 |
|
155 |
def get_download_link(file, file_type="mp3"):
|
156 |
-
# ⬇️ Cached download link
|
157 |
cache_key = f"dl_{file}"
|
158 |
if cache_key not in st.session_state['download_link_cache']:
|
159 |
with open(file, "rb") as f:
|
160 |
b64 = base64.b64encode(f.read()).decode()
|
161 |
-
|
|
|
162 |
return st.session_state['download_link_cache'][cache_key]
|
163 |
|
164 |
# 🎶 Audio Processing
|
|
|
153 |
return filename
|
154 |
|
155 |
def get_download_link(file, file_type="mp3"):
|
156 |
+
# ⬇️ Cached download link - Fixed Unicode issue!
|
157 |
cache_key = f"dl_{file}"
|
158 |
if cache_key not in st.session_state['download_link_cache']:
|
159 |
with open(file, "rb") as f:
|
160 |
b64 = base64.b64encode(f.read()).decode()
|
161 |
+
# Swapped ⬇️ with "Download" for safety
|
162 |
+
st.session_state['download_link_cache'][cache_key] = f'<a href="data:audio/mpeg;base64,{b64}" download="{os.path.basename(file)}">{FILE_EMOJIS.get(file_type, "Download")} Download {os.path.basename(file)}</a>'
|
163 |
return st.session_state['download_link_cache'][cache_key]
|
164 |
|
165 |
# 🎶 Audio Processing
|