Spaces:
Runtime error
Runtime error
Add agent and utils modules
Browse files- 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
|
| 10 |
-
self.
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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:
|