Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -164,11 +164,17 @@ def get_context_retriever_chain(vector_store):
|
|
| 164 |
|
| 165 |
# Conversational chain
|
| 166 |
def get_conversational_rag_chain(retriever_chain):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
llm = HuggingFaceHub(
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
|
|
|
| 172 |
|
| 173 |
prompt = ChatPromptTemplate.from_messages([
|
| 174 |
("system", "Answer the user's questions based on the below context:\n\n{context}"),
|
|
|
|
| 164 |
|
| 165 |
# Conversational chain
|
| 166 |
def get_conversational_rag_chain(retriever_chain):
|
| 167 |
+
# llm = HuggingFaceHub(
|
| 168 |
+
# repo_id="google/flan-t5-base",
|
| 169 |
+
# huggingfacehub_api_token=HF_TOKEN,
|
| 170 |
+
# model_kwargs={"temperature": 0.5, "max_length": 512}
|
| 171 |
+
# )
|
| 172 |
llm = HuggingFaceHub(
|
| 173 |
+
repo_id="google/flan-t5-small",
|
| 174 |
+
model_kwargs={"temperature": 0.5, "max_length": 512},
|
| 175 |
+
huggingfacehub_api_token=os.getenv("HUGGINGFACEHUB_API_TOKEN", "").strip()
|
| 176 |
+
)
|
| 177 |
+
|
| 178 |
|
| 179 |
prompt = ChatPromptTemplate.from_messages([
|
| 180 |
("system", "Answer the user's questions based on the below context:\n\n{context}"),
|