Update handler.py
Browse files- handler.py +4 -3
handler.py
CHANGED
|
@@ -4,12 +4,12 @@ from typing import Dict, List, Any
|
|
| 4 |
from llama_cpp import Llama
|
| 5 |
import gemma_tools as gem
|
| 6 |
|
| 7 |
-
MAX_TOKENS =
|
| 8 |
|
| 9 |
class EndpointHandler():
|
| 10 |
def __init__(self, data):
|
| 11 |
-
#
|
| 12 |
-
self.model = Llama.from_pretrained("njwright92/ComicBot_v.2-gguf", filename="
|
| 13 |
|
| 14 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 15 |
args = gem.get_args_or_none(data)
|
|
@@ -40,3 +40,4 @@ class EndpointHandler():
|
|
| 40 |
res = self.model(fmat, temperature=args["temperature"], top_p=args["top_p"], top_k=args["top_k"], max_tokens=max_length)
|
| 41 |
|
| 42 |
return res
|
|
|
|
|
|
| 4 |
from llama_cpp import Llama
|
| 5 |
import gemma_tools as gem
|
| 6 |
|
| 7 |
+
MAX_TOKENS = 8192
|
| 8 |
|
| 9 |
class EndpointHandler():
|
| 10 |
def __init__(self, data):
|
| 11 |
+
# Updated the model path and filename with your ComicBot model
|
| 12 |
+
self.model = Llama.from_pretrained("njwright92/ComicBot_v.2-gguf", filename="comic_mistral-v5.2.q5_0.gguf", n_ctx=8192)
|
| 13 |
|
| 14 |
def __call__(self, data: Dict[str, Any]) -> List[Dict[str, Any]]:
|
| 15 |
args = gem.get_args_or_none(data)
|
|
|
|
| 40 |
res = self.model(fmat, temperature=args["temperature"], top_p=args["top_p"], top_k=args["top_k"], max_tokens=max_length)
|
| 41 |
|
| 42 |
return res
|
| 43 |
+
|