-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] easy for use: auto publish package and image
- Loading branch information
1 parent
c23badc
commit 147f6eb
Showing
25 changed files
with
241 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
#!/bin/bash | ||
|
||
lizard -l python ./mlora -C 12 | ||
check_dir=( | ||
"./mlora" | ||
"./mlora_cli" | ||
) | ||
|
||
black --check ./mlora | ||
for dir in ${check_dir[*]}; do | ||
lizard -l python ${dir} -C 12 | ||
|
||
black --check ${dir} | ||
|
||
isort ${dir} --check --profile black | ||
|
||
flake8 ${dir} --count --show-source --statistics --max-line-length=88 --max-complexity 15 --ignore=E203,W503,E704 | ||
|
||
mypy ${dir} --ignore-missing-imports --non-interactive --install-types --check-untyped-defs | ||
done | ||
|
||
isort ./mlora --check --profile black | ||
|
||
flake8 ./mlora --count --show-source --statistics --max-line-length=88 --max-complexity 15 --ignore=E203,W503,E704 | ||
|
||
mypy ./mlora --ignore-missing-imports --non-interactive --install-types --check-untyped-defs | ||
|
||
pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM yezhengmaolove/mlora:latest | ||
|
||
MAINTAINER YeZhengMao <[email protected]> | ||
|
||
WORKDIR /mLoRA | ||
|
||
RUN git pull \ | ||
&& /usr/bin/echo -e '#!/bin/bash\neval "$(pyenv init -)"\neval "$(pyenv virtualenv-init -)"\npython mlora_server.py --base_model $BASE_MODEL --root $STORAGE_DIR' | tee /opt/deploy.sh | ||
|
||
ENV PYENV_ROOT=/root/.pyenv | ||
ENV PATH "$PYENV_ROOT/bin/:$PATH" | ||
|
||
CMD /bin/bash /opt/deploy.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
ln -sf pyproject.cli.toml pyproject.toml | ||
python -m build . | ||
|
||
ln -sf pyproject.mlora.toml pyproject.toml | ||
python -m build . |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ | |
|
||
import torch | ||
|
||
import mlora | ||
import mlora.profiler | ||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "mlora_cli" | ||
version = "0.2" | ||
description = "A cli tool for mLoRA system." | ||
readme = "README.md" | ||
requires-python = ">=3.12" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
] | ||
dependencies = ["rich", "InquirerPy"] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/TUDB-Labs/mLoRA" | ||
"Bug Tracker" = "https://github.com/TUDB-Labs/mLoRA/issues" | ||
|
||
[tool.setuptools.packages.find] | ||
include = [".*"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
G_PORT = 8000 | ||
G_HOST = "http://127.0.0.1" | ||
|
||
|
||
def url() -> str: | ||
global G_HOST | ||
global G_PORT | ||
|
||
return G_HOST + ":" + str(G_PORT) | ||
|
||
|
||
def help_set(): | ||
print("Usage of a set:") | ||
print(" host") | ||
print(" set the host.") | ||
print(" port") | ||
print(" set the port.") | ||
|
||
|
||
def do_set(_, args): | ||
args = args.split(" ") | ||
|
||
global G_PORT | ||
global G_HOST | ||
|
||
if args[0] == "host": | ||
G_HOST = args[1] | ||
elif args[0] == "port": | ||
# convert to int to check | ||
G_PORT = int(args[1]) | ||
else: | ||
help_set() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import cmd | ||
|
||
from .adapter import do_adapter, help_adapter | ||
from .dataset import do_dataset, help_dataset | ||
from .dispatcher import do_dispatcher, help_dispatcher | ||
from .file import do_file, help_file | ||
from .setting import do_set, help_set | ||
from .task import do_task, help_task | ||
|
||
|
||
def help_quit(_): | ||
print("Quit the cli") | ||
|
||
|
||
def do_quit(*_): | ||
exit(0) | ||
|
||
|
||
class mLoRAShell(cmd.Cmd): | ||
intro = "Welcome to the mLoRA CLI. Type help or ? to list commands.\n" | ||
prompt = "(mLoRA) " | ||
|
||
help_quit = help_quit | ||
do_quit = do_quit | ||
|
||
help_dispatcher = help_dispatcher | ||
do_dispatcher = do_dispatcher | ||
|
||
help_file = help_file | ||
do_file = do_file | ||
|
||
help_dataset = help_dataset | ||
do_dataset = do_dataset | ||
|
||
help_adapter = help_adapter | ||
do_adapter = do_adapter | ||
|
||
help_task = help_task | ||
do_task = do_task | ||
|
||
help_set = help_set | ||
do_set = do_set | ||
|
||
|
||
def cmd_loop(): | ||
mLoRAShell().cmdloop() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from mlora_cli.shell import cmd_loop | ||
|
||
if __name__ == "__main__": | ||
cmd_loop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
[project] | ||
name = "mlora_cli" | ||
version = "0.2.1" | ||
description = "The cli tools for mLoRA system." | ||
readme = "README.md" | ||
requires-python = ">=3.8" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
] | ||
dependencies = ["requests", "rich", "InquirerPy"] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/TUDB-Labs/mLoRA" | ||
"Bug Tracker" = "https://github.com/TUDB-Labs/mLoRA/issues" | ||
|
||
[build-system] | ||
requires = ["setuptools"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools.packages.find] | ||
include = ["mlora_cli", "mlora_cli.*"] | ||
|
||
[project.scripts] | ||
mlora_cli = "mlora_cli.shell:cmd_loop" |
Oops, something went wrong.