Skip to content

Commit

Permalink
Update model folder
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethleungty committed Jul 6, 2023
1 parent 3488725 commit 3e694fb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# GGML Models
models/*.bin


# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
1 change: 1 addition & 0 deletions models/model_download.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Download the desired quantized MPT-7B-Instruct model from https://huggingface.co/TheBloke/MPT-7B-Instruct-GGML/tree/main
4 changes: 2 additions & 2 deletions notebooks/main_CTransformers_LangChain.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
{
"cell_type": "code",
"execution_count": 8,
"id": "da64c2ce",
"id": "03928a6c",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -360,7 +360,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
"version": "3.9.12"
}
},
"nbformat": 4,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ipykernel = "^6.23.1"
ctransformers = "^0.2.5"
fastapi = "^0.96.0"
uvicorn = "^0.22.0"
ctransformers

[build-system]
requires = ["poetry-core"]
Expand Down
2 changes: 1 addition & 1 deletion src/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Note that the spacing and indentation of the prompt template is important for MPT-7B-Instruct, as it is highly sensitive to these
# whitespace changes. For example, it could have problems generating a summary from the pieces of context

mpt_7b_qa_template = """You are an expert HR assistant. Use the following pieces of information to answer the user's question.
qa_template = """You are an expert HR assistant. Use the following pieces of information to answer the user's question.
If you don't know the answer, just say that you don't know, don't try to make up an answer.
Context: {context}
Expand Down
3 changes: 1 addition & 2 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
from langchain.chains import RetrievalQA
from langchain.embeddings import HuggingFaceEmbeddings
from langchain.vectorstores import FAISS
from src.prompts import mpt_7b_qa_template
from src.utils import set_qa_prompt, build_retrieval_qa
from src.prompts import qa_template
from src.llm import build_llm

# Import config vars
Expand Down

0 comments on commit 3e694fb

Please sign in to comment.