Undo ollama commenting lol

This commit is contained in:
Ashwin Bharambe 2024-09-23 10:11:43 -07:00
parent 21b844c155
commit 2d7ce81302

View file

@ -30,21 +30,21 @@ OLLAMA_SUPPORTED_SKUS = {
class OllamaInferenceAdapter(Inference): class OllamaInferenceAdapter(Inference):
def __init__(self, url: str) -> None: def __init__(self, url: str) -> None:
self.url = url self.url = url
# tokenizer = Tokenizer.get_instance() tokenizer = Tokenizer.get_instance()
# self.formatter = ChatFormat(tokenizer) self.formatter = ChatFormat(tokenizer)
@property @property
def client(self) -> AsyncClient: def client(self) -> AsyncClient:
return AsyncClient(host=self.url) return AsyncClient(host=self.url)
async def initialize(self) -> None: async def initialize(self) -> None:
print("Ollama init") print("Initializing Ollama, checking connectivity to server...")
# try: try:
# await self.client.ps() await self.client.ps()
# except httpx.ConnectError as e: except httpx.ConnectError as e:
# raise RuntimeError( raise RuntimeError(
# "Ollama Server is not running, start it using `ollama serve` in a separate terminal" "Ollama Server is not running, start it using `ollama serve` in a separate terminal"
# ) from e ) from e
async def shutdown(self) -> None: async def shutdown(self) -> None:
pass pass