Skip to content

Commit

Permalink
upgrade langchain; went through demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Nov 20, 2023
1 parent ee99d85 commit 73563bb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions example/retrieval_qa/retrieval_qa_huggingface_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
# Load environment variables from .env file
load_dotenv()

## Set the RETRIEVAL_MODEL, pykoi supports most of the open-source LLMs, e.g.
# "HuggingFaceH4/zephyr-7b-beta"
# "meta-llama/Llama-2-7b-chat-hf"
# "mistralai/Mistral-7B-v0.1"
# "databricks/dolly-v2-3b"

RETRIEVAL_MODEL = os.getenv("RETRIEVAL_MODEL")


Expand Down
2 changes: 1 addition & 1 deletion pykoi/retrieval/llm/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def __init__(self, vector_db: AbsVectorDb, **kwargs):
model_id=kwargs.get("model_name"),
task="text-generation",
device=torch.cuda.device_count() - 1,
pipeline_kwargs={"device_map": "auto"},
# pipeline_kwargs={"device_map": "auto"},
model_kwargs={
"temperature": 0,
"max_length": kwargs.get("max_length", 500),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ einops = { version = "0.6.1", optional = true }
accelerate = { version = "0.21.0", optional = true }
bitsandbytes = { version = "0.40.2", optional = true }

langchain = { version = "0.0.220", optional = true }
langchain = { version = "0.0.338", optional = true }
scikit-learn = { version = "1.3.0", optional = true }
chromadb = { version = "0.3.26", optional = true }
pyepsilla = { version = ">=0.1.1", optional = true }
Expand Down

0 comments on commit 73563bb

Please sign in to comment.