Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
import pandas as pd
|
|
|
4 |
|
5 |
# Interface utilisateur
|
6 |
st.set_page_config(
|
@@ -102,7 +103,9 @@ if sentence:
|
|
102 |
html = generate_html(pictogram_ids)
|
103 |
st.components.v1.html(html, height=800, scrolling=True)
|
104 |
|
105 |
-
|
|
|
|
|
106 |
pdf_path = generate_pdf(pictogram_ids)
|
107 |
with open(pdf_path, "rb") as pdf_file:
|
108 |
-
st.download_button(label="Télécharger
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
|
3 |
import pandas as pd
|
4 |
+
from fpdf import FPDF
|
5 |
|
6 |
# Interface utilisateur
|
7 |
st.set_page_config(
|
|
|
103 |
html = generate_html(pictogram_ids)
|
104 |
st.components.v1.html(html, height=800, scrolling=True)
|
105 |
|
106 |
+
# Container to hold the download button
|
107 |
+
download_container = st.container()
|
108 |
+
with download_container:
|
109 |
pdf_path = generate_pdf(pictogram_ids)
|
110 |
with open(pdf_path, "rb") as pdf_file:
|
111 |
+
st.download_button(label="Télécharger la traduction en PDF", data=pdf_file, file_name="pictograms.pdf", mime="application/pdf")
|