fixed bug: qa chain doesn't return any source doc
Browse files
app_modules/llm_loader.py
CHANGED
|
@@ -90,13 +90,11 @@ class LLMLoader:
|
|
| 90 |
streamer: any
|
| 91 |
max_tokens_limit: int
|
| 92 |
|
| 93 |
-
def __init__(
|
| 94 |
-
self, llm_model_type, max_tokens_limit: int = 2048, lc_serve: bool = False
|
| 95 |
-
):
|
| 96 |
self.llm_model_type = llm_model_type
|
| 97 |
self.llm = None
|
| 98 |
self.streamer = None if lc_serve else TextIteratorStreamer("")
|
| 99 |
-
self.max_tokens_limit =
|
| 100 |
self.search_kwargs = {"k": 4}
|
| 101 |
|
| 102 |
def _init_streamer(self, tokenizer, custom_handler):
|
|
@@ -196,6 +194,9 @@ class LLMLoader:
|
|
| 196 |
)
|
| 197 |
print(f" HF auth token: {str(token)[-5:]}")
|
| 198 |
|
|
|
|
|
|
|
|
|
|
| 199 |
is_t5 = "t5" in MODEL_NAME_OR_PATH
|
| 200 |
temperature = (
|
| 201 |
0.01
|
|
|
|
| 90 |
streamer: any
|
| 91 |
max_tokens_limit: int
|
| 92 |
|
| 93 |
+
def __init__(self, llm_model_type, lc_serve: bool = False):
|
|
|
|
|
|
|
| 94 |
self.llm_model_type = llm_model_type
|
| 95 |
self.llm = None
|
| 96 |
self.streamer = None if lc_serve else TextIteratorStreamer("")
|
| 97 |
+
self.max_tokens_limit = 2048
|
| 98 |
self.search_kwargs = {"k": 4}
|
| 99 |
|
| 100 |
def _init_streamer(self, tokenizer, custom_handler):
|
|
|
|
| 194 |
)
|
| 195 |
print(f" HF auth token: {str(token)[-5:]}")
|
| 196 |
|
| 197 |
+
if "Llama-2" in MODEL_NAME_OR_PATH:
|
| 198 |
+
self.max_tokens_limit = 4096
|
| 199 |
+
|
| 200 |
is_t5 = "t5" in MODEL_NAME_OR_PATH
|
| 201 |
temperature = (
|
| 202 |
0.01
|