cecilemacaire commited on
Commit
e43c159
·
verified ·
1 Parent(s): ae4476a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
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
- if st.button("Télécharger en PDF"):
 
 
106
  pdf_path = generate_pdf(pictogram_ids)
107
  with open(pdf_path, "rb") as pdf_file:
108
- st.download_button(label="Télécharger le PDF", data=pdf_file, file_name="pictograms.pdf", mime="application/pdf")
 
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")