diff --git a/README.md b/README.md index 5141205..2fbd51d 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/__init__.py b/__init__.py index 43cd234..c85ed05 100644 --- a/__init__.py +++ b/__init__.py @@ -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)