Skip to content

Commit

Permalink
Merge pull request #7 from Aisuko/fix/structure
Browse files Browse the repository at this point in the history
Add new command and re-structure project
  • Loading branch information
Aisuko authored Apr 2, 2024
2 parents b99fcad + 33e6a11 commit 9343f22
Show file tree
Hide file tree
Showing 29 changed files with 104 additions and 787 deletions.
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

0 comments on commit 9343f22

Please sign in to comment.