Skip to content

Commit

Permalink
REF: rename package (xorbitsai#89)
Browse files Browse the repository at this point in the history
Co-authored-by: aresnow <[email protected]>
  • Loading branch information
UranusSeven and aresnow1 authored Jul 6, 2023
1 parent 784c1c8 commit 6f45b30
Show file tree
Hide file tree
Showing 44 changed files with 78 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
plexar/_version.py export-subst
xinference/_version.py export-subst
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A clear and concise description of what the bug is.
To help us to reproduce this bug, please provide information below:

1. Your Python version.
2. The version of Plexar you use.
2. The version of xinference you use.
3. Versions of crucial packages.
4. Full stack of the error.
5. Minimized code to reproduce the error.
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,21 @@ jobs:
- name: flake8 Lint
uses: py-actions/flake8@v2
with:
path: "plexar"
path: "xinference"
args: "--config setup.cfg"
- name: black
uses: psf/black@stable
with:
src: "plexar"
src: "xinference"
options: "--check"
- uses: isort/isort-action@master
with:
sortPaths: "plexar"
sortPaths: "xinference"
configuration: "--check-only --diff --sp setup.cfg"
- name: mypy
run: pip install mypy && mypy --install-types --non-interactive plexar
run: pip install mypy && mypy --install-types --non-interactive xinference
- name: codespell
run: pip install codespell && codespell plexar
run: pip install codespell && codespell xinference

build_test_job:
runs-on: ${{ matrix.os }}
Expand All @@ -61,7 +61,7 @@ jobs:
matrix:
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
module: [ "plexar" ]
module: [ "xinference" ]
exclude:
- { os: macos-latest, python-version: 3.9 }
- { os: macos-latest, python-version: 3.10 }
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
run: |
pytest --timeout=1500 \
-W ignore::PendingDeprecationWarning \
--cov-config=setup.cfg --cov-report=xml --cov=plexar plexar
--cov-config=setup.cfg --cov-report=xml --cov=xinference xinference
working-directory: .

- name: Report coverage data
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
files: plexar
files: xinference
repos:
- repo: https://github.com/psf/black
rev: 23.1.0
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ include setup.cfg
include pyproject.toml
global-exclude .DS_Store
include versioneer.py
include plexar/_version.py
include xinference/_version.py
global-exclude conftest.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# Plexar
# Xorbits inference
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
[tool.black]
include = '\.pyi?$'
extend-exclude = '''
^/plexar/(_version.py)
^/xinference/(_version.py)
'''

[tool.pytest.ini_options]
Expand Down
18 changes: 9 additions & 9 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[metadata]
name = plexar
description = Python actor framework for heterogeneous computing.
name = xinference
description = Model Serving Made Easy
author = Qin Xuye
author_email = [email protected]
maintainer = Qin Xuye
maintainer_email = [email protected]
license = Apache License 2.0
url = http://github.com/xprobe-inc/plexar
url = https://github.com/xorbitsai/inference
python_requires = >=3.8
classifier =
Operating System :: OS Independent
Expand Down Expand Up @@ -51,17 +51,17 @@ dev =

[options.entry_points]
console_scripts =
plexar = plexar.deploy.cmdline:cli
xinference = xinference.deploy.cmdline:cli

[coverage:run]
branch = True
relative_files = True
cover_pylib = False
plugins = Cython.Coverage
include =
plexar/*
xinference/*
omit =
plexar/_version.py
xinference/_version.py
*.pxd
*/tests/*

Expand All @@ -76,10 +76,10 @@ exclude_lines =
[versioneer]
VCS = git
style = pep440
versionfile_source = plexar/_version.py
versionfile_build = plexar/_version.py
versionfile_source = xinference/_version.py
versionfile_build = xinference/_version.py
tag_prefix = v
parentdir_prefix = plexar-
parentdir_prefix = xinference-

[flake8]
max-line-length = 100
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions plexar/_version.py → xinference/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def get_config():
cfg.VCS = "git"
cfg.style = "pep440"
cfg.tag_prefix = "v"
cfg.parentdir_prefix = "plexar-"
cfg.versionfile_source = "plexar/_version.py"
cfg.parentdir_prefix = "xinference-"
cfg.versionfile_source = "xinference/_version.py"
cfg.verbose = False
return cfg

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion plexar/conftest.py → xinference/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import pytest_asyncio
import xoscar as xo

from plexar.core.service import SupervisorActor, WorkerActor
from .core.service import SupervisorActor, WorkerActor


@pytest_asyncio.fixture
Expand Down
12 changes: 6 additions & 6 deletions plexar/constants.py → xinference/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
import os
from pathlib import Path

PLEXAR_HOME = str(Path.home() / ".plexar")
PLEXAR_CACHE_DIR = os.path.join(PLEXAR_HOME, "cache")
PLEXAR_LOG_DIR = os.path.join(PLEXAR_HOME, "logs")
XINFERENCE_HOME = str(Path.home() / ".xinference")
XINFERENCE_CACHE_DIR = os.path.join(XINFERENCE_HOME, "cache")
XINFERENCE_LOG_DIR = os.path.join(XINFERENCE_HOME, "logs")

PLEXAR_DEFAULT_HOST = "127.0.0.1"
PLEXAR_DEFAULT_SUPERVISOR_PORT = 9998
PLEXAR_DEFAULT_WORKER_PORT = 9999
XINFERENCE_DEFAULT_HOST = "127.0.0.1"
XINFERENCE_DEFAULT_SUPERVISOR_PORT = 9998
XINFERENCE_DEFAULT_WORKER_PORT = 9999
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions plexar/core/restful_api.py → xinference/core/restful_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
from typing_extensions import NotRequired, TypedDict
from uvicorn import Config, Server

from plexar.core.service import SupervisorActor
from plexar.isolation import Isolation
from plexar.model.llm.types import ChatCompletion, Completion
from ..isolation import Isolation
from .model.llm.types import ChatCompletion, Completion
from .service import SupervisorActor

max_tokens_field = Field(
default=16, ge=1, le=2048, description="The maximum number of tokens to generate."
Expand Down Expand Up @@ -248,7 +248,7 @@ def __init__(self, host: str, port: int):

@classmethod
def uid(cls) -> str:
return "plexar_RESTfulAPI"
return "RESTfulAPI"

async def __post_create__(self):
self._supervisor_ref = await xo.actor_ref(
Expand Down
6 changes: 3 additions & 3 deletions plexar/core/service.py → xinference/core/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __init__(self):

@classmethod
def uid(cls) -> str:
return "plexar_supervisor"
return "supervisor"

async def __post_create__(self):
self._check_dead_nodes_task = asyncio.create_task(self._check_dead_nodes())
Expand Down Expand Up @@ -170,7 +170,7 @@ def __init__(self, supervisor_address: str):

@classmethod
def uid(cls) -> str:
return "plexar_worker"
return "worker"

async def __post_create__(self):
self._supervisor_ref: xo.ActorRefType["SupervisorActor"] = await xo.actor_ref(
Expand All @@ -197,7 +197,7 @@ async def launch_builtin_model(
) -> xo.ActorRefType["ModelActor"]:
assert model_uid not in self._model_uid_to_model

from plexar.model import MODEL_FAMILIES
from ..model import MODEL_FAMILIES

for model_family in MODEL_FAMILIES:
model_spec = model_family.match(
Expand Down
File renamed without changes.
20 changes: 10 additions & 10 deletions plexar/deploy/cmdline.py → xinference/deploy/cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
from .. import __version__
from ..client import Client
from ..constants import (
PLEXAR_DEFAULT_HOST,
PLEXAR_DEFAULT_SUPERVISOR_PORT,
PLEXAR_DEFAULT_WORKER_PORT,
XINFERENCE_DEFAULT_HOST,
XINFERENCE_DEFAULT_SUPERVISOR_PORT,
XINFERENCE_DEFAULT_WORKER_PORT,
)


@click.group(name="plexar")
@click.group(name="xinference")
@click.version_option(__version__, "--version", "-v")
def cli():
pass
Expand All @@ -37,7 +37,7 @@ def cli():
@click.option(
"--address",
"-a",
default=f"{PLEXAR_DEFAULT_HOST}:{PLEXAR_DEFAULT_SUPERVISOR_PORT}",
default=f"{XINFERENCE_DEFAULT_HOST}:{XINFERENCE_DEFAULT_SUPERVISOR_PORT}",
type=str,
)
@click.option("--log-level", default="INFO", type=str)
Expand All @@ -63,12 +63,12 @@ def supervisor(
@click.option(
"--address",
"-a",
default=f"{PLEXAR_DEFAULT_HOST}:{PLEXAR_DEFAULT_WORKER_PORT}",
default=f"{XINFERENCE_DEFAULT_HOST}:{XINFERENCE_DEFAULT_WORKER_PORT}",
type=str,
)
@click.option(
"--supervisor-address",
default=f"{PLEXAR_DEFAULT_HOST}:{PLEXAR_DEFAULT_SUPERVISOR_PORT}",
default=f"{XINFERENCE_DEFAULT_HOST}:{XINFERENCE_DEFAULT_SUPERVISOR_PORT}",
type=str,
)
@click.option("--log-level", default="INFO", type=str)
Expand Down Expand Up @@ -130,7 +130,7 @@ def model_launch(
host: str,
port: str,
):
address = f"{PLEXAR_DEFAULT_HOST}:{PLEXAR_DEFAULT_SUPERVISOR_PORT}"
address = f"{XINFERENCE_DEFAULT_HOST}:{XINFERENCE_DEFAULT_SUPERVISOR_PORT}"

from .local import main

Expand All @@ -149,7 +149,7 @@ def model_launch(
@model.command("generate")
@click.option(
"--supervisor-address",
default=f"{PLEXAR_DEFAULT_HOST}:{PLEXAR_DEFAULT_SUPERVISOR_PORT}",
default=f"{XINFERENCE_DEFAULT_HOST}:{XINFERENCE_DEFAULT_SUPERVISOR_PORT}",
type=str,
)
@click.option("--model-uid", type=str)
Expand Down Expand Up @@ -189,7 +189,7 @@ async def generate_internal():
@click.option(
"--address",
"-a",
default=f"{PLEXAR_DEFAULT_HOST}:{PLEXAR_DEFAULT_SUPERVISOR_PORT}",
default=f"{XINFERENCE_DEFAULT_HOST}:{XINFERENCE_DEFAULT_SUPERVISOR_PORT}",
type=str,
)
@click.option("--model-uid", required=True, type=str)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import pytest
from click.testing import CliRunner

from plexar.client import Client
from plexar.deploy.cmdline import model_chat, model_generate
from ...client import Client
from ..cmdline import model_chat, model_generate


@pytest.mark.asyncio
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions plexar/model/__init__.py → xinference/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

from tqdm import tqdm

from ..constants import PLEXAR_CACHE_DIR
from ..constants import XINFERENCE_CACHE_DIR

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -130,7 +130,7 @@ def cache(
url = self.url_generator(model_size_in_billions, quantization)

full_name = f"{str(self)}-{model_size_in_billions}b-{quantization}"
save_dir = os.path.join(PLEXAR_CACHE_DIR, full_name)
save_dir = os.path.join(XINFERENCE_CACHE_DIR, full_name)
if not os.path.exists(save_dir):
os.makedirs(save_dir, exist_ok=True)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 13 additions & 0 deletions xinference/model/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2022-2023 XProbe Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
13 changes: 13 additions & 0 deletions xinference/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2022-2023 XProbe Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
File renamed without changes.

0 comments on commit 6f45b30

Please sign in to comment.