vikaso001 commited on
Commit
7d3e86a
·
verified ·
1 Parent(s): 5bbbdf3

Update rag_pipeline.py

Browse files
Files changed (1) hide show
  1. rag_pipeline.py +8 -8
rag_pipeline.py CHANGED
@@ -7,14 +7,14 @@ import torch
7
  logging.getLogger("pdfplumber").setLevel(logging.ERROR)
8
 
9
  # # Load model
10
- # qa_model = pipeline("text2text-generation", model="google/flan-t5-base", device=-1)
11
- qa_model= pipeline(
12
- "text-generation",
13
- model="meta-llama/Llama-2-7b-hf", # Replace with any other LLM model you have access to
14
- torch_dtype=torch.float16,
15
- device=0 if torch.cuda.is_available() else -1,
16
- max_new_tokens=500
17
- )
18
 
19
  def extract_text_from_pdf(pdf_input):
20
  text = ""
 
7
  logging.getLogger("pdfplumber").setLevel(logging.ERROR)
8
 
9
  # # Load model
10
+ qa_model = pipeline("text2text-generation", model="google/flan-t5-base", device=-1)
11
+ # qa_model= pipeline(
12
+ # "text-generation",
13
+ # model="meta-llama/Llama-2-7b-hf", # Replace with any other LLM model you have access to
14
+ # torch_dtype=torch.float16,
15
+ # device=0 if torch.cuda.is_available() else -1,
16
+ # max_new_tokens=500
17
+ # )
18
 
19
  def extract_text_from_pdf(pdf_input):
20
  text = ""