Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions example/llm/RAG-OGA/custom_llm/custom_llm.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Windows changed DLL path reference policy since Python 3.8
# Add the directory containing the DLLs to the DLL search path
import os

# check current python version
import sys
if sys.version_info >= (3, 8):
os.add_dll_directory(r"C:\Program Files\RyzenAI\1.5.1\deployment") # add path to your model dependent runtime DLLs

import warnings
import time
from typing import Any, Dict, List, Optional
Expand Down
6 changes: 3 additions & 3 deletions example/llm/RAG-OGA/rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


if args.gradio:
gradio_launch_app(dataset_path=r"./Dataset", model_path= r"path/to/llm") #update this path
gradio_launch_app(dataset_path=r"./Dataset", model_path= r"C:\huggingface") #update this path
exit()

# --- Paths ---
Expand All @@ -36,7 +36,7 @@

# --- Embedding Model ---
print("Using ONNX embedding model on VitisAI NPU...")
embedding_model = custom_embeddings(model_path="bge-large-en-v1.5.onnx", tokenizer_name="BAAI/bge-large-en-v1.5")
embedding_model = custom_embeddings(model_path="./custom_embedding/bge-large-en-v1.5.onnx", tokenizer_name="BAAI/bge-large-en-v1.5")

# --- Load or Build FAISS Index ---
if os.path.exists(os.path.join(faiss_index_path, "index.faiss")) and os.path.exists(os.path.join(faiss_index_path, "index.pkl")):
Expand Down Expand Up @@ -70,7 +70,7 @@
retriever = vectorstore.as_retriever(search_type='similarity',search_kwargs={"k": 3})
print("Number of vectors:", vectorstore.index.ntotal)

llm = custom_llm(model_path=r"path/to/llm") #update this path
llm = custom_llm(model_path=r"C:\huggingface") #update this path
# llm = custom_llm(model_path=r"C:\Users\akumar23\RAG-repo-xilinx\model") # Example

template = PromptTemplate.from_template("""<|system|>
Expand Down