Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -58,13 +58,14 @@ llm = HuggingFaceHub(repo_id=repo_id,
|
|
| 58 |
"top_k":50,
|
| 59 |
"top_p":0.95, "eos_token_id":49155})
|
| 60 |
|
| 61 |
-
prompt_template = """
|
| 62 |
-
You are a very helpful AI assistant. Please ONLY use {context} to answer the user's question {question}. If you don't know the answer, just say that you don't know. DON'T try to make up an answer.
|
| 63 |
-
Your response should be full and easy to understand.
|
| 64 |
-
"""
|
| 65 |
-
PROMPT = PromptTemplate(template=prompt_template, input_variables=["context", "question"])
|
| 66 |
-
|
| 67 |
-
chain = load_qa_chain(llm=llm, chain_type="stuff", prompt=PROMPT)
|
|
|
|
| 68 |
|
| 69 |
app = FastAPI()
|
| 70 |
|
|
|
|
| 58 |
"top_k":50,
|
| 59 |
"top_p":0.95, "eos_token_id":49155})
|
| 60 |
|
| 61 |
+
#prompt_template = """
|
| 62 |
+
#You are a very helpful AI assistant. Please ONLY use {context} to answer the user's question {question}. If you don't know the answer, just say that you don't know. DON'T try to make up an answer.
|
| 63 |
+
#Your response should be full and easy to understand.
|
| 64 |
+
#"""
|
| 65 |
+
#PROMPT = PromptTemplate(template=prompt_template, input_variables=["context", "question"])
|
| 66 |
+
|
| 67 |
+
#chain = load_qa_chain(llm=llm, chain_type="stuff", prompt=PROMPT)
|
| 68 |
+
chain = load_qa_chain(llm=llm, chain_type="stuff")
|
| 69 |
|
| 70 |
app = FastAPI()
|
| 71 |
|