Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new command and re-structure project #7

Merged
merged 3 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"name": "Auto - Debbug kimchima",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/kimchima.py",
"program": "${workspaceFolder}/src/kimchima/cmds/kimchima_cli.py",
"console": "integratedTerminal",
"purpose": [
"debug-in-terminal"
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"python.testing.unittestArgs": [
"-v",
"-s",
".",
"./src",
"-p",
"test_*.py"
],
Expand Down
6 changes: 0 additions & 6 deletions MANIFEST.in

This file was deleted.

7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#################################################################
TESTDIR:=src/kimchima/tests/

##############################Legacy#############################
.PHONY: setup
setup:
python setup.py sdist bdist_wheel
Expand All @@ -10,6 +14,7 @@ upload:
################################Poetry################################
.PHONY: poetry
poetry:
@poetry config virtualenvs.in-project true
@pipx install poetry==1.8.2


Expand All @@ -25,7 +30,7 @@ install:

.PHONY: test
test:
@poetry run python -m unittest discover -v
@poetry run python -m unittest discover ${TESTDIR} -v


# build and publish
Expand Down
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ The collections of tools for ML model development.

You can use it as a command line tool if you like. And you can also use it as a library. Or you can run it in VSCode with [`launch.json`](.vscode/launch.json).

## Command Line Tool

```bash
$ python -m kimchima auto sentence-transformers/all-MiniLM-L6-v2 Melbourne

```



# Acknowledgement
Expand Down
1 change: 0 additions & 1 deletion cmds/__init__.py

This file was deleted.

20 changes: 20 additions & 0 deletions examples/examples.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from kimchima import Auto, get_device, get_capability

model = Auto(model_name_or_path="sentence-transformers/all-MiniLM-L6-v2")

# computing embeddings for single text
embeddings = model.get_embeddings(text="Melbourne")
print(embeddings.shape)

# computing embeddings for multiple texts
embeddings = model.get_embeddings(text=["Melbourne", "Sydney"])
print(embeddings.shape)

# Checking the device: GPU, mps and CPU
device = get_device()
print(device)


# get capability of GPU(Nvidia)
capability = get_capability()
print(capability)
2 changes: 0 additions & 2 deletions pkg/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion pkg/auto/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion pkg/devices/__init__.py

This file was deleted.

1 change: 0 additions & 1 deletion pkg/dump/__init__.py

This file was deleted.

147 changes: 0 additions & 147 deletions pkg/dump/dump.py

This file was deleted.

1 change: 0 additions & 1 deletion pkg/model/__init__.py

This file was deleted.

Loading
Loading