Skip to content

Commit

Permalink
API: Split into separate folder
Browse files Browse the repository at this point in the history
Moving the API into its own directory helps compartmentalize it
and allows for cleaning up the main file to just contain bootstrapping
and the entry point.

Signed-off-by: kingbri <[email protected]>
  • Loading branch information
bdashore3 committed Mar 12, 2024
1 parent 26b21df commit cdffa8f
Show file tree
Hide file tree
Showing 13 changed files with 635 additions and 621 deletions.
620 changes: 620 additions & 0 deletions endpoints/OAI/app.py

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import Union, List, Optional, Dict
from uuid import uuid4

from OAI.types.common import UsageStats, CommonCompletionRequest
from endpoints.OAI.types.common import UsageStats, CommonCompletionRequest


class ChatCompletionLogprob(BaseModel):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import Dict, List, Optional, Union
from uuid import uuid4

from OAI.types.common import CommonCompletionRequest, UsageStats
from endpoints.OAI.types.common import CommonCompletionRequest, UsageStats


class CompletionLogProbs(BaseModel):
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions OAI/utils/completion.py → endpoints/OAI/utils/completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Optional

from common.utils import unwrap
from OAI.types.chat_completion import (
from endpoints.OAI.types.chat_completion import (
ChatCompletionLogprobs,
ChatCompletionLogprob,
ChatCompletionMessage,
Expand All @@ -11,12 +11,12 @@
ChatCompletionResponse,
ChatCompletionStreamChoice,
)
from OAI.types.completion import (
from endpoints.OAI.types.completion import (
CompletionResponse,
CompletionRespChoice,
CompletionLogProbs,
)
from OAI.types.common import UsageStats
from endpoints.OAI.types.common import UsageStats


def create_completion_response(generation: dict, model_name: Optional[str]):
Expand Down
2 changes: 1 addition & 1 deletion OAI/utils/lora.py → endpoints/OAI/utils/lora.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pathlib

from OAI.types.lora import LoraCard, LoraList
from endpoints.OAI.types.lora import LoraCard, LoraList


def get_lora_list(lora_path: pathlib.Path):
Expand Down
2 changes: 1 addition & 1 deletion OAI/utils/model.py → endpoints/OAI/utils/model.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pathlib
from typing import Optional

from OAI.types.model import ModelCard, ModelList
from endpoints.OAI.types.model import ModelCard, ModelList


def get_model_list(model_path: pathlib.Path, draft_model_path: Optional[str] = None):
Expand Down
Loading

0 comments on commit cdffa8f

Please sign in to comment.