Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,8 @@ from langchain_community.llms import llamacpp, huggingface_pipeline
|
|
9 |
from langchain.prompts import PromptTemplate
|
10 |
from langchain.chains import LLMChain
|
11 |
from langchain.chains.question_answering import load_qa_chain
|
12 |
-
from huggingface_hub import hf_hub_download
|
13 |
-
|
14 |
|
15 |
_template = """Given the following conversation and a follow up question, rephrase the follow up question to be a
|
16 |
standalone question without changing the content in given question.
|
@@ -22,8 +22,6 @@ system_prompt = """You are a helpful assistant, you will use the provided contex
|
|
22 |
Read the given context before answering questions and think step by step. If you can not answer a user question based on the provided context, inform the user.
|
23 |
Do not use any other information for answering the user. Provide a detailed answer to the question."""
|
24 |
|
25 |
-
load_dotenv()
|
26 |
-
|
27 |
def load_quantized_model(model_id=None):
|
28 |
MODEL_ID, MODEL_BASENAME = "TheBloke/zephyr-7B-beta-GGUF","zephyr-7b-beta.Q5_K_S.gguf"
|
29 |
try:
|
|
|
9 |
from langchain.prompts import PromptTemplate
|
10 |
from langchain.chains import LLMChain
|
11 |
from langchain.chains.question_answering import load_qa_chain
|
12 |
+
from huggingface_hub import hf_hub_download, login
|
13 |
+
login(os.environ['hf_token'])
|
14 |
|
15 |
_template = """Given the following conversation and a follow up question, rephrase the follow up question to be a
|
16 |
standalone question without changing the content in given question.
|
|
|
22 |
Read the given context before answering questions and think step by step. If you can not answer a user question based on the provided context, inform the user.
|
23 |
Do not use any other information for answering the user. Provide a detailed answer to the question."""
|
24 |
|
|
|
|
|
25 |
def load_quantized_model(model_id=None):
|
26 |
MODEL_ID, MODEL_BASENAME = "TheBloke/zephyr-7B-beta-GGUF","zephyr-7b-beta.Q5_K_S.gguf"
|
27 |
try:
|