From 52819e34e005e0db07610037622469e9de76aabf Mon Sep 17 00:00:00 2001 From: Adam Wilson Date: Thu, 15 May 2025 10:10:41 -0600 Subject: [PATCH] fix deprecated refs --- .github/workflows/llmsecops-cicd.test.yml | 2 ++ tests/llm/llm_rag.py | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/llmsecops-cicd.test.yml b/.github/workflows/llmsecops-cicd.test.yml index a23c7932e..a660db422 100644 --- a/.github/workflows/llmsecops-cicd.test.yml +++ b/.github/workflows/llmsecops-cicd.test.yml @@ -32,5 +32,7 @@ jobs: pip install accelerate pip install optimum[exporters,onnxruntime] pip install faiss-cpu + pip install hf_xet + python -m tests.llm.llm_rag diff --git a/tests/llm/llm_rag.py b/tests/llm/llm_rag.py index 8bdbe50b9..1bfda28ae 100644 --- a/tests/llm/llm_rag.py +++ b/tests/llm/llm_rag.py @@ -7,8 +7,8 @@ from typing import List import numpy as np # LangChain imports -from langchain_community.llms import HuggingFacePipeline -from langchain_community.embeddings import HuggingFaceEmbeddings +from langchain_huggingface import HuggingFacePipeline +from langchain_huggingface import HuggingFaceEmbeddings from langchain.text_splitter import RecursiveCharacterTextSplitter from langchain_community.vectorstores import FAISS from langchain.chains import RetrievalQA @@ -160,7 +160,7 @@ def ask_rag(question: str): print(f"\nQuestion: {question}") # Get response from the chain - response = qa_chain({"query": question}) + response = qa_chain.invoke({"query": question}) # Print the answer print("\nAnswer:")