fix: 🐛 templating fix for queued LLM

This commit is contained in:
Nate Sesti 2023-09-07 00:57:28 -07:00
parent 44070ac185
commit 5c6609ab5f
2 changed files with 7 additions and 2 deletions

View file

@ -1,6 +1,6 @@
import json
import ssl
from typing import Any, Coroutine, List, Optional
from typing import Any, Callable, Coroutine, Dict, List, Optional
import aiohttp
@ -19,7 +19,9 @@ class GGML(LLM):
ca_bundle_path: str = None
model: str = "ggml"
template_messages = llama2_template_messages
template_messages: Optional[
Callable[[List[Dict[str, str]]], str]
] = llama2_template_messages
prompt_templates = {
"edit": simplified_edit_prompt,

View file

@ -19,6 +19,9 @@ class QueuedLLM(LLM):
await self.llm.start(*args, **kwargs)
self._lock = asyncio.Lock()
self.model = self.llm.model
self.template_messages = self.llm.template_messages
self.prompt_templates = self.llm.prompt_templates
self.context_length = self.llm.context_length
async def stop(self):
await self.llm.stop()