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

Update rag_pipeline.py

Browse files
Files changed (1) hide show
  1. rag_pipeline.py +7 -3
rag_pipeline.py CHANGED
@@ -8,9 +8,13 @@ logging.getLogger("pdfplumber").setLevel(logging.ERROR)
8
 
9
  # # Load model
10
  # qa_model = pipeline("text2text-generation", model="google/flan-t5-base", device=-1)
11
- model_id = "meta-llama/Meta-Llama-3-8B"
12
-
13
- qa_model = transformers.pipeline("text2text-generation", model=model_id, model_kwargs={"torch_dtype": torch.bfloat16}, device_map=-1)
 
 
 
 
14
 
15
  def extract_text_from_pdf(pdf_input):
16
  text = ""
 
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 = ""