Spaces:
Runtime error
Runtime error
updated imports and model arguments
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ from PyPDF2 import PdfReader
|
|
| 6 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
| 7 |
from langchain.callbacks.manager import CallbackManager
|
| 8 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
| 9 |
-
|
| 10 |
from langchain.vectorstores import Qdrant
|
| 11 |
from qdrant_client.http import models
|
| 12 |
# from langchain.llms import CTransformers
|
|
@@ -28,8 +28,10 @@ print("loading the LLM......................................")
|
|
| 28 |
|
| 29 |
llm = LlamaCpp(
|
| 30 |
model_path="./llama-2-7b-chat.Q3_K_S.gguf",
|
|
|
|
| 31 |
n_ctx=2048,
|
| 32 |
f16_kv=True, # MUST set to True, otherwise you will run into problem after a couple of calls
|
|
|
|
| 33 |
callback_manager=callback_manager,
|
| 34 |
verbose=True,
|
| 35 |
)
|
|
|
|
| 6 |
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
| 7 |
from langchain.callbacks.manager import CallbackManager
|
| 8 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
| 9 |
+
from langchain.llms import LlamaCpp
|
| 10 |
from langchain.vectorstores import Qdrant
|
| 11 |
from qdrant_client.http import models
|
| 12 |
# from langchain.llms import CTransformers
|
|
|
|
| 28 |
|
| 29 |
llm = LlamaCpp(
|
| 30 |
model_path="./llama-2-7b-chat.Q3_K_S.gguf",
|
| 31 |
+
temperature = 0.2,
|
| 32 |
n_ctx=2048,
|
| 33 |
f16_kv=True, # MUST set to True, otherwise you will run into problem after a couple of calls
|
| 34 |
+
max_tokens = 500,
|
| 35 |
callback_manager=callback_manager,
|
| 36 |
verbose=True,
|
| 37 |
)
|