Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -72,14 +72,20 @@ def get_conversational_rag_chain(retriever_chain,llm):
|
|
| 72 |
return create_retrieval_chain(retriever_chain, stuff_documents_chain)
|
| 73 |
|
| 74 |
def get_response(user_input):
|
| 75 |
-
llm = CTransformers(
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
)
|
| 84 |
retriever_chain = get_context_retriever_chain(st.session_state.vector_store,llm)
|
| 85 |
conversation_rag_chain = get_conversational_rag_chain(retriever_chain,llm)
|
|
|
|
| 72 |
return create_retrieval_chain(retriever_chain, stuff_documents_chain)
|
| 73 |
|
| 74 |
def get_response(user_input):
|
| 75 |
+
# llm = CTransformers(
|
| 76 |
+
# # model = "TheBloke/Mistral-7B-Instruct-v0.2-GGUF",
|
| 77 |
+
# model= "TheBloke/Llama-2-7B-Chat-GGUF",
|
| 78 |
+
# model_file = "llama-2-7b-chat.Q3_K_S.gguf",
|
| 79 |
+
# model_type="llama",
|
| 80 |
+
# max_new_tokens = 300,
|
| 81 |
+
# temperature = 0.3,
|
| 82 |
+
# lib="avx2", # for CPU
|
| 83 |
+
# )
|
| 84 |
+
|
| 85 |
+
llm_model == "TinyLlama/TinyLlama-1.1B-Chat-v1.0":
|
| 86 |
+
llm = HuggingFaceHub(
|
| 87 |
+
repo_id=llm_model,
|
| 88 |
+
model_kwargs={"temperature": temperature, "max_new_tokens": 250, "top_k": top_k}
|
| 89 |
)
|
| 90 |
retriever_chain = get_context_retriever_chain(st.session_state.vector_store,llm)
|
| 91 |
conversation_rag_chain = get_conversational_rag_chain(retriever_chain,llm)
|