LamiaYT commited on
Commit
e9922ee
·
1 Parent(s): d05acc0

Add agent and utils modules

Browse files
Files changed (1) hide show
  1. agent/local_llm.py +11 -4
agent/local_llm.py CHANGED
@@ -6,10 +6,17 @@ import os
6
 
7
 
8
  class LocalLLM:
9
- def __init__(self, model_name: str = "TinyLlama/TinyLlama-1.1B-Chat-v1.0", use_gpt2_fallback: bool = True):
10
- self.model_name = model_name
11
- self.use_gpt2_fallback = use_gpt2_fallback
12
- self.llm = None
 
 
 
 
 
 
 
13
 
14
  def load_model(self):
15
  try:
 
6
 
7
 
8
  class LocalLLM:
9
+ def __init__(self):
10
+ self.llm = HuggingFaceLLM(
11
+ context_window=3900,
12
+ max_new_tokens=256,
13
+ model_name="TinyLlama/TinyLlama-1.1B-Chat-v1.0",
14
+ tokenizer_name="TinyLlama/TinyLlama-1.1B-Chat-v1.0",
15
+ device_map="auto"
16
+ )
17
+
18
+ def get_llm(self):
19
+ return self.llm
20
 
21
  def load_model(self):
22
  try: