Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,22 +40,24 @@ def display_generated_content(col, generated_content, content_type):
|
|
| 40 |
# Usar un enfoque diferente para la descarga
|
| 41 |
b64 = base64.b64encode(generated_content.encode()).decode()
|
| 42 |
|
| 43 |
-
# Crear botón de descarga superior con HTML
|
| 44 |
top_button_html = f"""
|
| 45 |
-
<
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
| 50 |
"""
|
| 51 |
|
| 52 |
-
# Crear botón de descarga inferior con HTML
|
| 53 |
bottom_button_html = f"""
|
| 54 |
-
<
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
|
|
|
| 59 |
"""
|
| 60 |
|
| 61 |
# Mostrar botón de descarga superior
|
|
@@ -79,22 +81,24 @@ def display_generated_content(col, generated_content, content_type):
|
|
| 79 |
# Codificar el contenido para descarga
|
| 80 |
b64 = base64.b64encode(generated_content.encode()).decode()
|
| 81 |
|
| 82 |
-
# Crear botón de descarga superior con
|
| 83 |
top_button_html = f"""
|
| 84 |
-
<
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
|
|
|
| 89 |
"""
|
| 90 |
|
| 91 |
-
# Crear botón de descarga inferior con
|
| 92 |
bottom_button_html = f"""
|
| 93 |
-
<
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
|
|
|
| 98 |
"""
|
| 99 |
|
| 100 |
# Mostrar botón de descarga superior
|
|
|
|
| 40 |
# Usar un enfoque diferente para la descarga
|
| 41 |
b64 = base64.b64encode(generated_content.encode()).decode()
|
| 42 |
|
| 43 |
+
# Crear botón de descarga superior con HTML mejorado
|
| 44 |
top_button_html = f"""
|
| 45 |
+
<a href="data:text/plain;base64,{b64}" download="{file_name}"
|
| 46 |
+
style="display: inline-block; padding: 0.5em 1em; color: white; background-color: #4CAF50;
|
| 47 |
+
text-align: center; text-decoration: none; font-size: 16px; margin: 4px 2px;
|
| 48 |
+
cursor: pointer; border-radius: 4px; font-weight: bold;">
|
| 49 |
+
{download_label}
|
| 50 |
+
</a>
|
| 51 |
"""
|
| 52 |
|
| 53 |
+
# Crear botón de descarga inferior con HTML mejorado
|
| 54 |
bottom_button_html = f"""
|
| 55 |
+
<a href="data:text/plain;base64,{b64}" download="{file_name}"
|
| 56 |
+
style="display: inline-block; padding: 0.5em 1em; color: white; background-color: #4CAF50;
|
| 57 |
+
text-align: center; text-decoration: none; font-size: 16px; margin: 4px 2px;
|
| 58 |
+
cursor: pointer; border-radius: 4px; font-weight: bold;">
|
| 59 |
+
{download_label}
|
| 60 |
+
</a>
|
| 61 |
"""
|
| 62 |
|
| 63 |
# Mostrar botón de descarga superior
|
|
|
|
| 81 |
# Codificar el contenido para descarga
|
| 82 |
b64 = base64.b64encode(generated_content.encode()).decode()
|
| 83 |
|
| 84 |
+
# Crear botón de descarga superior con HTML mejorado
|
| 85 |
top_button_html = f"""
|
| 86 |
+
<a href="data:text/plain;base64,{b64}" download="{file_name}"
|
| 87 |
+
style="display: inline-block; padding: 0.5em 1em; color: white; background-color: #4CAF50;
|
| 88 |
+
text-align: center; text-decoration: none; font-size: 16px; margin: 4px 2px;
|
| 89 |
+
cursor: pointer; border-radius: 4px; font-weight: bold;">
|
| 90 |
+
{download_label}
|
| 91 |
+
</a>
|
| 92 |
"""
|
| 93 |
|
| 94 |
+
# Crear botón de descarga inferior con HTML mejorado
|
| 95 |
bottom_button_html = f"""
|
| 96 |
+
<a href="data:text/plain;base64,{b64}" download="{file_name}"
|
| 97 |
+
style="display: inline-block; padding: 0.5em 1em; color: white; background-color: #4CAF50;
|
| 98 |
+
text-align: center; text-decoration: none; font-size: 16px; margin: 4px 2px;
|
| 99 |
+
cursor: pointer; border-radius: 4px; font-weight: bold;">
|
| 100 |
+
{download_label}
|
| 101 |
+
</a>
|
| 102 |
"""
|
| 103 |
|
| 104 |
# Mostrar botón de descarga superior
|