Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,8 @@ from langchain.vectorstores import FAISS
|
|
| 5 |
import torch
|
| 6 |
from transformers import AutoTokenizer, AutoModel
|
| 7 |
import gradio as gr
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Load and preprocess PDF text
|
| 10 |
def extract_text_from_pdf(pdf_path):
|
|
@@ -16,7 +18,8 @@ def extract_text_from_pdf(pdf_path):
|
|
| 16 |
return text
|
| 17 |
|
| 18 |
# Extract text from the PDF
|
| 19 |
-
pdf_text = extract_text_from_pdf('
|
|
|
|
| 20 |
|
| 21 |
# Convert the text to a DataFrame
|
| 22 |
df = pd.DataFrame({'text': [pdf_text]})
|
|
|
|
| 5 |
import torch
|
| 6 |
from transformers import AutoTokenizer, AutoModel
|
| 7 |
import gradio as gr
|
| 8 |
+
from langchain_community.vectorstores import FAISS
|
| 9 |
+
|
| 10 |
|
| 11 |
# Load and preprocess PDF text
|
| 12 |
def extract_text_from_pdf(pdf_path):
|
|
|
|
| 18 |
return text
|
| 19 |
|
| 20 |
# Extract text from the PDF
|
| 21 |
+
pdf_text = extract_text_from_pdf('Getting Started with Ubuntu 16.04.pdf')
|
| 22 |
+
|
| 23 |
|
| 24 |
# Convert the text to a DataFrame
|
| 25 |
df = pd.DataFrame({'text': [pdf_text]})
|