Spaces:
Build error
Build error
Update rag_pipeline.py
Browse files- 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 |
-
|
| 11 |
-
qa_model= pipeline(
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 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 = ""
|