Spaces:
Build error
Build error
Update rag_agent.py
Browse files- rag_agent.py +6 -0
rag_agent.py
CHANGED
|
@@ -6,6 +6,12 @@ from llama_index.embeddings.huggingface import HuggingFaceEmbedding
|
|
| 6 |
from llama_index.core.tools import QueryEngineTool, ToolMetadata
|
| 7 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
# ==== 1. Set up Hugging Face Embedding Model ====
|
| 10 |
# Use HuggingFaceEmbedding from llama_index directly
|
| 11 |
Settings.embed_model = HuggingFaceEmbedding(model_name="sentence-transformers/all-MiniLM-L6-v2")
|
|
|
|
| 6 |
from llama_index.core.tools import QueryEngineTool, ToolMetadata
|
| 7 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 8 |
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
export HUGGINGFACEHUB_API_TOKEN=HF_TOKEN
|
| 12 |
+
from huggingface_hub import login
|
| 13 |
+
login()
|
| 14 |
+
|
| 15 |
# ==== 1. Set up Hugging Face Embedding Model ====
|
| 16 |
# Use HuggingFaceEmbedding from llama_index directly
|
| 17 |
Settings.embed_model = HuggingFaceEmbedding(model_name="sentence-transformers/all-MiniLM-L6-v2")
|