app.py
Browse files
app.py
CHANGED
|
@@ -85,9 +85,9 @@ class BSIChatbot:
|
|
| 85 |
return self.vectorstore.similarity_search(query=query, k=20)
|
| 86 |
|
| 87 |
def initialize_llm(self):
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
llm = AutoModelForCausalLM.from_pretrained(self.llm_path)
|
| 91 |
self.llmtokenizer = AutoTokenizer.from_pretrained(self.llm_path)
|
| 92 |
self.streamer = TextIteratorStreamer(self.llmtokenizer, skip_prompt=True)
|
| 93 |
self.llmpipeline = pipeline(
|
|
|
|
| 85 |
return self.vectorstore.similarity_search(query=query, k=20)
|
| 86 |
|
| 87 |
def initialize_llm(self):
|
| 88 |
+
bnb_config = BitsAndBytesConfig(load_in_8bit=True)
|
| 89 |
+
llm = AutoModelForCausalLM.from_pretrained(self.llm_path, quantization_config=bnb_config)
|
| 90 |
+
#llm = AutoModelForCausalLM.from_pretrained(self.llm_path)
|
| 91 |
self.llmtokenizer = AutoTokenizer.from_pretrained(self.llm_path)
|
| 92 |
self.streamer = TextIteratorStreamer(self.llmtokenizer, skip_prompt=True)
|
| 93 |
self.llmpipeline = pipeline(
|