Browse Source
Debug
Signed-off-by: Jael Gu <mengjia.gu@zilliz.com>
main
2 changed files with
7 additions and
15 deletions
-
README.md
-
__init__.py
|
|
@ -50,13 +50,7 @@ Create the operator via the following factory method |
|
|
|
***model_name***: *str* |
|
|
|
|
|
|
|
The model name in string. |
|
|
|
You can get the list of supported model names by calling `model_list` of the operator: |
|
|
|
```python |
|
|
|
from towhee import ops |
|
|
|
|
|
|
|
|
|
|
|
ops.text_embedding.transformers.model_list() |
|
|
|
``` |
|
|
|
You can get the list of supported model names by calling `get_model_list`. |
|
|
|
|
|
|
|
|
|
|
|
## Interface |
|
|
@ -74,7 +68,9 @@ Text embeddings are returned in ndarray. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**Returns**: *numpy.ndarray* |
|
|
|
**Returns**: |
|
|
|
|
|
|
|
*numpy.ndarray* |
|
|
|
|
|
|
|
The text embedding extracted by model. |
|
|
|
|
|
|
|
|
|
@ -12,12 +12,8 @@ |
|
|
|
# See the License for the specific language governing permissions and |
|
|
|
# limitations under the License. |
|
|
|
|
|
|
|
from .auto_transformers import AutoTransformers, get_model_list |
|
|
|
from .auto_transformers import AutoTransformers |
|
|
|
|
|
|
|
|
|
|
|
def transformers(model_name: str): |
|
|
|
return AutoTransformers(model_name) |
|
|
|
|
|
|
|
|
|
|
|
def model_list(): |
|
|
|
return get_model_list() |
|
|
|
def transformers(**kwargs): |
|
|
|
return AutoTransformers(**kwargs) |
|
|
|