FridayMaster commited on
Commit
fe28712
·
verified ·
1 Parent(s): 1842c48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -1,8 +1,8 @@
1
  import pandas as pd
2
  import fitz # PyMuPDF for PDF extraction
3
  import spacy
4
- from langchain.chains import ConversationalRetrievalChain
5
- from langchain.llms import OpenAI
6
  from langchain_community.vectorstores import FAISS # Updated import
7
  import torch
8
  from transformers import AutoTokenizer, AutoModel
@@ -18,7 +18,7 @@ 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') # Ensure this path is correct
22
 
23
  # Convert the text to a DataFrame
24
  df = pd.DataFrame({'text': [pdf_text]})
@@ -77,4 +77,3 @@ iface = gr.Interface(
77
  if __name__ == "__main__":
78
  iface.launch()
79
 
80
-
 
1
  import pandas as pd
2
  import fitz # PyMuPDF for PDF extraction
3
  import spacy
4
+ from langchain_community.chains import ConversationalRetrievalChain
5
+ from langchain_community.llms import OpenAI # Updated import
6
  from langchain_community.vectorstores import FAISS # Updated import
7
  import torch
8
  from transformers import AutoTokenizer, AutoModel
 
18
  return text
19
 
20
  # Extract text from the PDF
21
+ pdf_text = extract_text_from_pdf('Getting_Started_with_Ubuntu_16.04.pdf') # Replace with your PDF path
22
 
23
  # Convert the text to a DataFrame
24
  df = pd.DataFrame({'text': [pdf_text]})
 
77
  if __name__ == "__main__":
78
  iface.launch()
79