awacke1 commited on
Commit
25e0d92
·
verified ·
1 Parent(s): e987f4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
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
- 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 {os.path.basename(file)}</a>'
 
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