Spaces:
Runtime error
Runtime error
Commit ·
c1ebdbf
1
Parent(s): b5385e0
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,52 +1,5 @@
|
|
| 1 |
-
# -*- coding: utf-8 -*-
|
| 2 |
-
"""PDF Summariser - Gradio
|
| 3 |
-
|
| 4 |
-
Automatically generated by Colaboratory.
|
| 5 |
-
|
| 6 |
-
Original file is located at
|
| 7 |
-
https://colab.research.google.com/drive/1OwEPVFMVN6xQrfpd_FyiCj0BTw-eDRDK
|
| 8 |
-
|
| 9 |
-
### Chat PDF (texted) v0.1 - Developed by Jacky Chow 2020-03-31
|
| 10 |
-
(How to use)
|
| 11 |
-
|
| 12 |
-
1. Go to runtime and chick run all.
|
| 13 |
-
|
| 14 |
-
2. In the first block, click on the upload button and select the pdf for which you want to study
|
| 15 |
-
|
| 16 |
-
3. Waif for around one to couple minutes, let the computer to scan the text and create indexing
|
| 17 |
-
|
| 18 |
-
4. Go to output chatbox and start the ask question related to that pdf document
|
| 19 |
-
"""
|
| 20 |
-
|
| 21 |
-
# from google.colab import files
|
| 22 |
-
|
| 23 |
-
# # Prompt the user for a filename
|
| 24 |
-
# # filename = input("Please enter the filename to upload: ")
|
| 25 |
-
# filename = 't.pdf'
|
| 26 |
-
|
| 27 |
-
# # Use files.upload() to allow the user to upload a file
|
| 28 |
-
# uploaded_files = files.upload()
|
| 29 |
-
|
| 30 |
-
# # Get the first uploaded file (assuming only one file was uploaded)
|
| 31 |
-
# uploaded_file = next(iter(uploaded_files))
|
| 32 |
-
|
| 33 |
-
# # Get the contents of the uploaded file
|
| 34 |
-
# file_contents = uploaded_files[uploaded_file]
|
| 35 |
-
|
| 36 |
-
# # Specify the new filename
|
| 37 |
-
# new_filename = "t1.pdf"
|
| 38 |
-
|
| 39 |
-
# # Write the contents of the uploaded file to the new file
|
| 40 |
-
# with open(new_filename, "wb") as f:
|
| 41 |
-
# f.write(file_contents)
|
| 42 |
-
|
| 43 |
-
# # Print a confirmation message
|
| 44 |
-
# print(f"File {uploaded_file} was saved as {new_filename}")
|
| 45 |
-
|
| 46 |
-
"""# Programming Code (no need to view by general user)"""
|
| 47 |
-
|
| 48 |
# !pip install -q gpt_index
|
| 49 |
-
!pip install
|
| 50 |
!pip install -q PyPDF2
|
| 51 |
!pip install -q gradio
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# !pip install -q gpt_index
|
| 2 |
+
!pip install llama-index
|
| 3 |
!pip install -q PyPDF2
|
| 4 |
!pip install -q gradio
|
| 5 |
|