display pdf
Browse files- app.py +6 -1
- requirements.txt +1 -0
app.py
CHANGED
@@ -9,6 +9,7 @@ from transformers import pipeline
|
|
9 |
import torch
|
10 |
import os
|
11 |
import presentation as customClass
|
|
|
12 |
|
13 |
|
14 |
api_key = os.getenv("API_KEY")
|
@@ -81,7 +82,7 @@ def extract_data(feed):
|
|
81 |
pages = pdf.pages
|
82 |
for p in pages:
|
83 |
data.append(p.extract_text())
|
84 |
-
|
85 |
return None
|
86 |
|
87 |
|
@@ -94,6 +95,10 @@ def main():
|
|
94 |
uploaded_file = st.file_uploader('Choose your .pdf file', type="pdf")
|
95 |
if uploaded_file is not None:
|
96 |
extract_data(uploaded_file)
|
|
|
|
|
|
|
|
|
97 |
if st.button("Make PPT"):
|
98 |
ai_ppt(data)
|
99 |
|
|
|
9 |
import torch
|
10 |
import os
|
11 |
import presentation as customClass
|
12 |
+
from streamlit_pdf_viewer import pdf_viewer
|
13 |
|
14 |
|
15 |
api_key = os.getenv("API_KEY")
|
|
|
82 |
pages = pdf.pages
|
83 |
for p in pages:
|
84 |
data.append(p.extract_text())
|
85 |
+
|
86 |
return None
|
87 |
|
88 |
|
|
|
95 |
uploaded_file = st.file_uploader('Choose your .pdf file', type="pdf")
|
96 |
if uploaded_file is not None:
|
97 |
extract_data(uploaded_file)
|
98 |
+
|
99 |
+
binary_data = uploaded_file.getvalue()
|
100 |
+
pdf_viewer(input=binary_data,
|
101 |
+
width=700)
|
102 |
if st.button("Make PPT"):
|
103 |
ai_ppt(data)
|
104 |
|
requirements.txt
CHANGED
@@ -6,4 +6,5 @@ pydantic_ai
|
|
6 |
nest_asyncio
|
7 |
torch==2.2.2
|
8 |
transformers==4.39.1
|
|
|
9 |
#pydantic_ai.models.groq
|
|
|
6 |
nest_asyncio
|
7 |
torch==2.2.2
|
8 |
transformers==4.39.1
|
9 |
+
streamlit_pdf_viewer
|
10 |
#pydantic_ai.models.groq
|