|
1 | 1 | [](https://github.com/dayyass/muse_as_service/actions/workflows/tests.yml)
|
2 | 2 | [](https://github.com/dayyass/muse_as_service/actions/workflows/linter.yml)
|
3 | 3 | [](https://codecov.io/gh/dayyass/muse_as_service)
|
| 4 | + |
4 | 5 | [](https://github.com/dayyass/muse_as_service#requirements)
|
5 |
| -[](https://github.com/dayyass/muse_as_service/blob/main/LICENSE) |
6 | 6 | [](https://github.com/dayyass/muse_as_service/releases/latest)
|
7 |
| -[](https://github.com/dayyass/muse_as_service/blob/main/.pre-commit-config.yaml) |
| 7 | +[](https://github.com/dayyass/muse_as_service/blob/main/LICENSE) |
| 8 | + |
| 9 | +[](https://github.com/dayyass/muse_as_service/blob/main/.pre-commit-config.yaml) |
8 | 10 | [](https://github.com/psf/black)
|
9 | 11 |
|
| 12 | +[](https://pypi.org/project/muse-as-service/1.1.0/) |
| 13 | +[](https://pypi.org/project/muse-as-service/1.1.0/) |
| 14 | + |
10 | 15 | ### What is MUSE?
|
11 | 16 | **MUSE** stands for Multilingual Universal Sentence Encoder - multilingual extension (supports [16 languages](https://github.com/dayyass/muse_as_service#muse-supported-languages)) of Universal Sentence Encoder (USE).<br>
|
12 | 17 | MUSE model encodes sentences into embedding vectors of fixed size.
|
@@ -86,21 +91,21 @@ MUSE as Service supports **GPU** inference. To launch the service with GPU suppo
|
86 | 91 | ### Usage
|
87 | 92 | Since the service is usually running on server, it is important to restrict access to the service.
|
88 | 93 |
|
89 |
| -For this reason, MUSE as Service uses **token-based authorization** with [JWT](https://jwt.io) for users in sqlite database [app.db](https://github.com/dayyass/muse_as_service/tree/main/muse_as_service/database/app.db). |
| 94 | +For this reason, MUSE as Service uses **token-based authorization** with [JWT](https://jwt.io) for users in sqlite database [app.db](https://github.com/dayyass/muse_as_service/tree/main/src/muse_as_service/database/app.db). |
90 | 95 |
|
91 | 96 | Initially database has only one user with:
|
92 | 97 | - **username**: "admin"
|
93 | 98 | - **password**: "admin"
|
94 | 99 |
|
95 | 100 | To add new user with `username` and `password` run:
|
96 | 101 | ```shell script
|
97 |
| -python muse_as_service/database/add_user.py --username {username} --password {password} |
| 102 | +python src/muse_as_service/database/add_user.py --username {username} --password {password} |
98 | 103 | ```
|
99 | 104 | **NOTE**: no passwords are stored in the database, only their hashes.
|
100 | 105 |
|
101 | 106 | To remove the user with `username` run:
|
102 | 107 | ```shell script
|
103 |
| -python muse_as_service/database/remove_user.py --username {username} |
| 108 | +python src/muse_as_service/database/remove_user.py --username {username} |
104 | 109 | ```
|
105 | 110 |
|
106 | 111 | MUSE as Service has the following endpoints:
|
@@ -164,6 +169,11 @@ print(embedding.shape) # (2, 512)
|
164 | 169 |
|
165 | 170 | However it is better to use built-in client **MUSEClient** for sentence tokenization and embedding, that wraps the functionality of the python **requests** package and provides user with a simpler interface.
|
166 | 171 |
|
| 172 | +To install the built-in client run:<br> |
| 173 | +` |
| 174 | +pip install muse-as-service |
| 175 | +` |
| 176 | + |
167 | 177 | Instead of using endpoints, listed above, directly, **MUSEClient** provides the following methods to work with:
|
168 | 178 | <pre>
|
169 | 179 | - login - method to login with `username` and `password`
|
|
0 commit comments