Skip to content

Commit 6f45b30

Browse files
REF: rename package (#89)
Co-authored-by: aresnow <[email protected]>
1 parent 784c1c8 commit 6f45b30

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+78
-52
lines changed

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
plexar/_version.py export-subst
1+
xinference/_version.py export-subst

.github/ISSUE_TEMPLATE/bug_report.md

+1-1

.github/workflows/python.yaml

+7-7
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@ jobs:
3232
- name: flake8 Lint
3333
uses: py-actions/flake8@v2
3434
with:
35-
path: "plexar"
35+
path: "xinference"
3636
args: "--config setup.cfg"
3737
- name: black
3838
uses: psf/black@stable
3939
with:
40-
src: "plexar"
40+
src: "xinference"
4141
options: "--check"
4242
- uses: isort/isort-action@master
4343
with:
44-
sortPaths: "plexar"
44+
sortPaths: "xinference"
4545
configuration: "--check-only --diff --sp setup.cfg"
4646
- name: mypy
47-
run: pip install mypy && mypy --install-types --non-interactive plexar
47+
run: pip install mypy && mypy --install-types --non-interactive xinference
4848
- name: codespell
49-
run: pip install codespell && codespell plexar
49+
run: pip install codespell && codespell xinference
5050

5151
build_test_job:
5252
runs-on: ${{ matrix.os }}
@@ -61,7 +61,7 @@ jobs:
6161
matrix:
6262
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
6363
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
64-
module: [ "plexar" ]
64+
module: [ "xinference" ]
6565
exclude:
6666
- { os: macos-latest, python-version: 3.9 }
6767
- { os: macos-latest, python-version: 3.10 }
@@ -95,7 +95,7 @@ jobs:
9595
run: |
9696
pytest --timeout=1500 \
9797
-W ignore::PendingDeprecationWarning \
98-
--cov-config=setup.cfg --cov-report=xml --cov=plexar plexar
98+
--cov-config=setup.cfg --cov-report=xml --cov=xinference xinference
9999
working-directory: .
100100

101101
- name: Report coverage data

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
files: plexar
1+
files: xinference
22
repos:
33
- repo: https://github.com/psf/black
44
rev: 23.1.0

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ include setup.cfg
66
include pyproject.toml
77
global-exclude .DS_Store
88
include versioneer.py
9-
include plexar/_version.py
9+
include xinference/_version.py
1010
global-exclude conftest.py

README.md

+1-1

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build-backend = "setuptools.build_meta"
77
[tool.black]
88
include = '\.pyi?$'
99
extend-exclude = '''
10-
^/plexar/(_version.py)
10+
^/xinference/(_version.py)
1111
'''
1212

1313
[tool.pytest.ini_options]

setup.cfg

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[metadata]
2-
name = plexar
3-
description = Python actor framework for heterogeneous computing.
2+
name = xinference
3+
description = Model Serving Made Easy
44
author = Qin Xuye
55
author_email = [email protected]
66
maintainer = Qin Xuye
77
maintainer_email = [email protected]
88
license = Apache License 2.0
9-
url = http://github.com/xprobe-inc/plexar
9+
url = https://github.com/xorbitsai/inference
1010
python_requires = >=3.8
1111
classifier =
1212
Operating System :: OS Independent
@@ -51,17 +51,17 @@ dev =
5151

5252
[options.entry_points]
5353
console_scripts =
54-
plexar = plexar.deploy.cmdline:cli
54+
xinference = xinference.deploy.cmdline:cli
5555

5656
[coverage:run]
5757
branch = True
5858
relative_files = True
5959
cover_pylib = False
6060
plugins = Cython.Coverage
6161
include =
62-
plexar/*
62+
xinference/*
6363
omit =
64-
plexar/_version.py
64+
xinference/_version.py
6565
*.pxd
6666
*/tests/*
6767

@@ -76,10 +76,10 @@ exclude_lines =
7676
[versioneer]
7777
VCS = git
7878
style = pep440
79-
versionfile_source = plexar/_version.py
80-
versionfile_build = plexar/_version.py
79+
versionfile_source = xinference/_version.py
80+
versionfile_build = xinference/_version.py
8181
tag_prefix = v
82-
parentdir_prefix = plexar-
82+
parentdir_prefix = xinference-
8383

8484
[flake8]
8585
max-line-length = 100
File renamed without changes.

plexar/_version.py renamed to xinference/_version.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def get_config():
4444
cfg.VCS = "git"
4545
cfg.style = "pep440"
4646
cfg.tag_prefix = "v"
47-
cfg.parentdir_prefix = "plexar-"
48-
cfg.versionfile_source = "plexar/_version.py"
47+
cfg.parentdir_prefix = "xinference-"
48+
cfg.versionfile_source = "xinference/_version.py"
4949
cfg.verbose = False
5050
return cfg
5151

File renamed without changes.

plexar/conftest.py renamed to xinference/conftest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import pytest_asyncio
1717
import xoscar as xo
1818

19-
from plexar.core.service import SupervisorActor, WorkerActor
19+
from .core.service import SupervisorActor, WorkerActor
2020

2121

2222
@pytest_asyncio.fixture

plexar/constants.py renamed to xinference/constants.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
import os
1616
from pathlib import Path
1717

18-
PLEXAR_HOME = str(Path.home() / ".plexar")
19-
PLEXAR_CACHE_DIR = os.path.join(PLEXAR_HOME, "cache")
20-
PLEXAR_LOG_DIR = os.path.join(PLEXAR_HOME, "logs")
18+
XINFERENCE_HOME = str(Path.home() / ".xinference")
19+
XINFERENCE_CACHE_DIR = os.path.join(XINFERENCE_HOME, "cache")
20+
XINFERENCE_LOG_DIR = os.path.join(XINFERENCE_HOME, "logs")
2121

22-
PLEXAR_DEFAULT_HOST = "127.0.0.1"
23-
PLEXAR_DEFAULT_SUPERVISOR_PORT = 9998
24-
PLEXAR_DEFAULT_WORKER_PORT = 9999
22+
XINFERENCE_DEFAULT_HOST = "127.0.0.1"
23+
XINFERENCE_DEFAULT_SUPERVISOR_PORT = 9998
24+
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.

plexar/core/restful_api.py renamed to xinference/core/restful_api.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
from typing_extensions import NotRequired, TypedDict
2424
from uvicorn import Config, Server
2525

26-
from plexar.core.service import SupervisorActor
27-
from plexar.isolation import Isolation
28-
from plexar.model.llm.types import ChatCompletion, Completion
26+
from ..isolation import Isolation
27+
from .model.llm.types import ChatCompletion, Completion
28+
from .service import SupervisorActor
2929

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

249249
@classmethod
250250
def uid(cls) -> str:
251-
return "plexar_RESTfulAPI"
251+
return "RESTfulAPI"
252252

253253
async def __post_create__(self):
254254
self._supervisor_ref = await xo.actor_ref(

plexar/core/service.py renamed to xinference/core/service.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def __init__(self):
6464

6565
@classmethod
6666
def uid(cls) -> str:
67-
return "plexar_supervisor"
67+
return "supervisor"
6868

6969
async def __post_create__(self):
7070
self._check_dead_nodes_task = asyncio.create_task(self._check_dead_nodes())
@@ -170,7 +170,7 @@ def __init__(self, supervisor_address: str):
170170

171171
@classmethod
172172
def uid(cls) -> str:
173-
return "plexar_worker"
173+
return "worker"
174174

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

200-
from plexar.model import MODEL_FAMILIES
200+
from ..model import MODEL_FAMILIES
201201

202202
for model_family in MODEL_FAMILIES:
203203
model_spec = model_family.match(
File renamed without changes.

plexar/deploy/cmdline.py renamed to xinference/deploy/cmdline.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
from .. import __version__
2222
from ..client import Client
2323
from ..constants import (
24-
PLEXAR_DEFAULT_HOST,
25-
PLEXAR_DEFAULT_SUPERVISOR_PORT,
26-
PLEXAR_DEFAULT_WORKER_PORT,
24+
XINFERENCE_DEFAULT_HOST,
25+
XINFERENCE_DEFAULT_SUPERVISOR_PORT,
26+
XINFERENCE_DEFAULT_WORKER_PORT,
2727
)
2828

2929

30-
@click.group(name="plexar")
30+
@click.group(name="xinference")
3131
@click.version_option(__version__, "--version", "-v")
3232
def cli():
3333
pass
@@ -37,7 +37,7 @@ def cli():
3737
@click.option(
3838
"--address",
3939
"-a",
40-
default=f"{PLEXAR_DEFAULT_HOST}:{PLEXAR_DEFAULT_SUPERVISOR_PORT}",
40+
default=f"{XINFERENCE_DEFAULT_HOST}:{XINFERENCE_DEFAULT_SUPERVISOR_PORT}",
4141
type=str,
4242
)
4343
@click.option("--log-level", default="INFO", type=str)
@@ -63,12 +63,12 @@ def supervisor(
6363
@click.option(
6464
"--address",
6565
"-a",
66-
default=f"{PLEXAR_DEFAULT_HOST}:{PLEXAR_DEFAULT_WORKER_PORT}",
66+
default=f"{XINFERENCE_DEFAULT_HOST}:{XINFERENCE_DEFAULT_WORKER_PORT}",
6767
type=str,
6868
)
6969
@click.option(
7070
"--supervisor-address",
71-
default=f"{PLEXAR_DEFAULT_HOST}:{PLEXAR_DEFAULT_SUPERVISOR_PORT}",
71+
default=f"{XINFERENCE_DEFAULT_HOST}:{XINFERENCE_DEFAULT_SUPERVISOR_PORT}",
7272
type=str,
7373
)
7474
@click.option("--log-level", default="INFO", type=str)
@@ -130,7 +130,7 @@ def model_launch(
130130
host: str,
131131
port: str,
132132
):
133-
address = f"{PLEXAR_DEFAULT_HOST}:{PLEXAR_DEFAULT_SUPERVISOR_PORT}"
133+
address = f"{XINFERENCE_DEFAULT_HOST}:{XINFERENCE_DEFAULT_SUPERVISOR_PORT}"
134134

135135
from .local import main
136136

@@ -149,7 +149,7 @@ def model_launch(
149149
@model.command("generate")
150150
@click.option(
151151
"--supervisor-address",
152-
default=f"{PLEXAR_DEFAULT_HOST}:{PLEXAR_DEFAULT_SUPERVISOR_PORT}",
152+
default=f"{XINFERENCE_DEFAULT_HOST}:{XINFERENCE_DEFAULT_SUPERVISOR_PORT}",
153153
type=str,
154154
)
155155
@click.option("--model-uid", type=str)
@@ -189,7 +189,7 @@ async def generate_internal():
189189
@click.option(
190190
"--address",
191191
"-a",
192-
default=f"{PLEXAR_DEFAULT_HOST}:{PLEXAR_DEFAULT_SUPERVISOR_PORT}",
192+
default=f"{XINFERENCE_DEFAULT_HOST}:{XINFERENCE_DEFAULT_SUPERVISOR_PORT}",
193193
type=str,
194194
)
195195
@click.option("--model-uid", required=True, type=str)
File renamed without changes.
File renamed without changes.
File renamed without changes.

plexar/deploy/test/test_cmdline.py renamed to xinference/deploy/test/test_cmdline.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
import pytest
1717
from click.testing import CliRunner
1818

19-
from plexar.client import Client
20-
from plexar.deploy.cmdline import model_chat, model_generate
19+
from ...client import Client
20+
from ..cmdline import model_chat, model_generate
2121

2222

2323
@pytest.mark.asyncio
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

plexar/model/__init__.py renamed to xinference/model/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
from tqdm import tqdm
2121

22-
from ..constants import PLEXAR_CACHE_DIR
22+
from ..constants import XINFERENCE_CACHE_DIR
2323

2424
logger = logging.getLogger(__name__)
2525

@@ -130,7 +130,7 @@ def cache(
130130
url = self.url_generator(model_size_in_billions, quantization)
131131

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

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.

xinference/model/tests/__init__.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2022-2023 XProbe Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.

xinference/tests/__init__.py

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright 2022-2023 XProbe Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
File renamed without changes.

0 commit comments

Comments
 (0)