Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import re
|
|
| 3 |
import numpy as np
|
| 4 |
import matplotlib.pyplot as plt
|
| 5 |
from io import BytesIO
|
| 6 |
-
|
| 7 |
|
| 8 |
def run_turkish():
|
| 9 |
# Başlık
|
|
@@ -33,22 +33,31 @@ def run_turkish():
|
|
| 33 |
|
| 34 |
# Resimler yalnızca show_images True ise gösterilir
|
| 35 |
if st.session_state.show_images:
|
| 36 |
-
#
|
| 37 |
-
|
| 38 |
-
filename = "NoteAnalyzerTurkish.pdf" # İndirilecek dosyanın adı
|
| 39 |
|
| 40 |
-
#
|
| 41 |
-
pdf_path =
|
| 42 |
|
| 43 |
-
#
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
-
|
| 51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
#akldnaslkdnmllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
|
| 54 |
# Notları yükleme ve işleme işlemleri (Butona basıldıysa çalışır)
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
import matplotlib.pyplot as plt
|
| 5 |
from io import BytesIO
|
| 6 |
+
import os
|
| 7 |
|
| 8 |
def run_turkish():
|
| 9 |
# Başlık
|
|
|
|
| 33 |
|
| 34 |
# Resimler yalnızca show_images True ise gösterilir
|
| 35 |
if st.session_state.show_images:
|
| 36 |
+
# Uygulama başlığı
|
| 37 |
+
st.title("NoteAnalyzerTurkish.pdf Gösterimi")
|
|
|
|
| 38 |
|
| 39 |
+
# PDF dosyasının yolu
|
| 40 |
+
pdf_path = os.path.join("turkish", "NoteAnalyzerTurkish.pdf")
|
| 41 |
|
| 42 |
+
# PDF'nin mevcut olup olmadığını kontrol edin
|
| 43 |
+
if os.path.exists(pdf_path):
|
| 44 |
+
# PDF dosyasını göster
|
| 45 |
+
with open(pdf_path, "rb") as pdf_file:
|
| 46 |
+
pdf_data = pdf_file.read()
|
| 47 |
|
| 48 |
+
st.download_button(
|
| 49 |
+
label="PDF İndir",
|
| 50 |
+
data=pdf_data,
|
| 51 |
+
file_name="NoteAnalyzerTurkish.pdf",
|
| 52 |
+
mime="application/pdf"
|
| 53 |
+
)
|
| 54 |
|
| 55 |
+
st.markdown(
|
| 56 |
+
f'<iframe src="data:application/pdf;base64,{pdf_data.hex()}" width="700" height="500"></iframe>',
|
| 57 |
+
unsafe_allow_html=True
|
| 58 |
+
)
|
| 59 |
+
else:
|
| 60 |
+
st.error("PDF dosyası bulunamadı!")
|
| 61 |
|
| 62 |
#akldnaslkdnmllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
|
| 63 |
# Notları yükleme ve işleme işlemleri (Butona basıldıysa çalışır)
|