Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,21 +8,21 @@
|
|
| 8 |
# PDF
|
| 9 |
# -------------------------
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
|
| 27 |
|
| 28 |
#!apt-get install poppler-utils
|
|
@@ -274,8 +274,11 @@ def read_pdf(pdf_path):
|
|
| 274 |
#drive.mount('/content/drive')
|
| 275 |
|
| 276 |
#pdf_path = 'C:/Users/Cristina/Documents/MDS/TERM1_AppliedArtificialIntelligence/Assesment3/NIPS-2015-hidden-technical-debt-in-machine-learning-systems-Paper.pdf'
|
| 277 |
-
pdf_path="C:/Users/Cristina/Documents/MDS/TERM1_AppliedArtificialIntelligence/Assesment3/hidden-technical-debt-in-machine-learning-systems-Paper.pdf"
|
| 278 |
-
pdf_path2="C:/Users/Cristina/Documents/MDS/TERM1_AppliedArtificialIntelligence/Assesment3/1812_05944.pdf"
|
|
|
|
|
|
|
|
|
|
| 279 |
|
| 280 |
|
| 281 |
text_per_page = read_pdf(pdf_path)
|
|
@@ -333,8 +336,8 @@ def sentence_to_audio(summary_text):
|
|
| 333 |
summary_txt="It is dangerous to think of machine learning as a free-to-use toolkit, as it is common to incur ongoing maintenance costs in real-world ML systems"
|
| 334 |
sentence_to_audio(summary_txt)
|
| 335 |
|
| 336 |
-
pdf_path="
|
| 337 |
-
pdf_path2="
|
| 338 |
|
| 339 |
demo = gr.Interface(fn=sentence_to_audio, inputs="file", outputs="audio",examples=[pdf_path,pdf_path2])
|
| 340 |
demo.launch(share=True)
|
|
|
|
| 8 |
# PDF
|
| 9 |
# -------------------------
|
| 10 |
|
| 11 |
+
#!pip install PyPDF2
|
| 12 |
+
#!pip install pdfminer.six
|
| 13 |
+
#!pip install pdfplumber
|
| 14 |
+
#!pip install pdf2image
|
| 15 |
+
#!pip install Pillow
|
| 16 |
+
#!pip install pytesseract
|
| 17 |
+
#!pip install poppler-utils
|
| 18 |
+
#!pip install tesseract-ocr
|
| 19 |
+
#!pip install libtesseract-dev
|
| 20 |
+
|
| 21 |
+
#!pip install fastapi
|
| 22 |
+
#!pip install -q torch
|
| 23 |
+
#!pip install -q transformers
|
| 24 |
+
#!pip install -q gradio
|
| 25 |
+
#!pip install ffmpeg
|
| 26 |
|
| 27 |
|
| 28 |
#!apt-get install poppler-utils
|
|
|
|
| 274 |
#drive.mount('/content/drive')
|
| 275 |
|
| 276 |
#pdf_path = 'C:/Users/Cristina/Documents/MDS/TERM1_AppliedArtificialIntelligence/Assesment3/NIPS-2015-hidden-technical-debt-in-machine-learning-systems-Paper.pdf'
|
| 277 |
+
#pdf_path="C:/Users/Cristina/Documents/MDS/TERM1_AppliedArtificialIntelligence/Assesment3/hidden-technical-debt-in-machine-learning-systems-Paper.pdf"
|
| 278 |
+
#pdf_path2="C:/Users/Cristina/Documents/MDS/TERM1_AppliedArtificialIntelligence/Assesment3/1812_05944.pdf"
|
| 279 |
+
|
| 280 |
+
pdf_path=os.path.join(os.path.abspath(""), "hidden-technical-debt-in-machine-learning-systems-Paper")
|
| 281 |
+
pdf_path2=os.path.join(os.path.abspath(""), "1812_05944.pdf")
|
| 282 |
|
| 283 |
|
| 284 |
text_per_page = read_pdf(pdf_path)
|
|
|
|
| 336 |
summary_txt="It is dangerous to think of machine learning as a free-to-use toolkit, as it is common to incur ongoing maintenance costs in real-world ML systems"
|
| 337 |
sentence_to_audio(summary_txt)
|
| 338 |
|
| 339 |
+
pdf_path=os.path.join(os.path.abspath(""), "hidden-technical-debt-in-machine-learning-systems-Paper")
|
| 340 |
+
pdf_path2=os.path.join(os.path.abspath(""), "1812_05944.pdf")
|
| 341 |
|
| 342 |
demo = gr.Interface(fn=sentence_to_audio, inputs="file", outputs="audio",examples=[pdf_path,pdf_path2])
|
| 343 |
demo.launch(share=True)
|