we got it to BUILD
This commit is contained in:
@@ -3,13 +3,9 @@ name = "exo-core"
|
||||
version = "0.1.0"
|
||||
description = "Add your description here"
|
||||
readme = "README.md"
|
||||
authors = [
|
||||
{ name = "Evan", email = "[email protected]" }
|
||||
]
|
||||
authors = [{ name = "Evan", email = "[email protected]" }]
|
||||
requires-python = ">=3.13"
|
||||
dependencies = [
|
||||
"pydantic",
|
||||
]
|
||||
dependencies = ["pydantic"]
|
||||
|
||||
[build-system]
|
||||
requires = ["uv_build>=0.9.24,<0.10.0"]
|
||||
|
||||
@@ -2,12 +2,19 @@ from abc import ABC, abstractmethod
|
||||
from collections.abc import Callable, Iterable
|
||||
from typing import Self
|
||||
|
||||
|
||||
class TaskId(str): ...
|
||||
|
||||
|
||||
class Cancelled: ...
|
||||
|
||||
|
||||
class Finished: ...
|
||||
|
||||
|
||||
CANCEL_ALL_TASKS = TaskId("CANCEL_TALL_TASKS")
|
||||
|
||||
|
||||
class Engine[TaskType, ResponseType](ABC):
|
||||
_cancelled_tasks: set[TaskId]
|
||||
|
||||
@@ -32,13 +39,12 @@ class Engine[TaskType, ResponseType](ABC):
|
||||
@abstractmethod
|
||||
def step(
|
||||
self,
|
||||
) -> Iterable[
|
||||
tuple[TaskId, ResponseType | Cancelled | Finished]
|
||||
]: ...
|
||||
) -> Iterable[tuple[TaskId, ResponseType | Cancelled | Finished]]: ...
|
||||
|
||||
@abstractmethod
|
||||
def close(self) -> None: ...
|
||||
|
||||
|
||||
class EngineBuilder[SetupType, TaskType, ResponseType](ABC):
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
@@ -62,4 +68,3 @@ class EngineBuilder[SetupType, TaskType, ResponseType](ABC):
|
||||
|
||||
@abstractmethod
|
||||
def close(self) -> None: ...
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ import aiofiles
|
||||
import aiofiles.os as aios
|
||||
import tomlkit
|
||||
from anyio import Path, open_file
|
||||
from exo.shared.types.common import ModelId
|
||||
from exo.shared.types.memory import Memory
|
||||
from exo.utils.pydantic_ext import CamelCaseModel
|
||||
from huggingface_hub import model_info
|
||||
from loguru import logger
|
||||
from pydantic import (
|
||||
@@ -23,9 +26,6 @@ from exo.shared.constants import (
|
||||
EXO_ENABLE_IMAGE_MODELS,
|
||||
RESOURCES_DIR,
|
||||
)
|
||||
from exo.shared.types.common import ModelId
|
||||
from exo.shared.types.memory import Memory
|
||||
from exo.utils.pydantic_ext import CamelCaseModel
|
||||
|
||||
# kinda ugly...
|
||||
# TODO: load search path from config.toml
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from enum import Enum
|
||||
|
||||
from exo.shared.types.common import Host, Id, NodeId
|
||||
from exo.shared.types.worker.runners import RunnerId, ShardAssignments, ShardMetadata
|
||||
from pydantic import model_validator
|
||||
|
||||
from exo_core.model_cards import ModelTask
|
||||
from exo.shared.types.common import Host, Id, NodeId
|
||||
from exo.shared.types.worker.runners import RunnerId, ShardAssignments, ShardMetadata
|
||||
from exo_core.pydantic_ext import CamelCaseModel, TaggedModel
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from collections.abc import Generator
|
||||
from typing import Any, Literal
|
||||
|
||||
from exo.utils.pydantic_ext import TaggedModel
|
||||
|
||||
from exo.api.types import (
|
||||
FinishReason,
|
||||
GenerationStats,
|
||||
@@ -9,7 +11,6 @@ from exo.api.types import (
|
||||
TopLogprobItem,
|
||||
Usage,
|
||||
)
|
||||
from exo.utils.pydantic_ext import TaggedModel
|
||||
|
||||
|
||||
class BaseRunnerResponse(TaggedModel):
|
||||
|
||||
@@ -3,9 +3,9 @@ from collections.abc import Mapping
|
||||
from pydantic import model_validator
|
||||
|
||||
from exo_core.model_cards import ModelId
|
||||
from exo_core.pydantic import CamelCaseModel, TaggedModel
|
||||
from exo_core.types.common import Id, NodeId
|
||||
from exo_core.types.shards import ShardMetadata
|
||||
from exo_core.pydantic import CamelCaseModel, TaggedModel
|
||||
|
||||
|
||||
class RunnerId(Id):
|
||||
|
||||
@@ -6,12 +6,12 @@ from exo.api.types import (
|
||||
ImageEditsTaskParams,
|
||||
ImageGenerationTaskParams,
|
||||
)
|
||||
from exo_core.pydantic import TaggedModel
|
||||
from exo_core.types.common import CommandId, Id
|
||||
from exo_core.types.text_generation import TextGenerationTaskParams
|
||||
from exo_core.types.instances import BoundInstance, InstanceId
|
||||
from exo_core.types.runners import RunnerId
|
||||
from exo_core.types.shards import ShardMetadata
|
||||
from exo_core.pydantic import TaggedModel
|
||||
from exo_core.types.text_generation import TextGenerationTaskParams
|
||||
|
||||
|
||||
class TaskId(Id):
|
||||
|
||||
Reference in New Issue
Block a user