Skip to content

Error when passing show_progress_bar as a parameter for HFTextVectorizer #362

@raphaeldelio

Description

@raphaeldelio

When creating an HFTextVectorizer and passing show_progress_bar=False, an error is thrown by SentenceTransformers — I haven't found another way of disabling the progress bar from polluting logs.

Expected behavior:
• The progress bar should be hidden when show_progress_bar=False.

Actual behavior:
• An error is thrown:

  File "/Users/raphaeldelio/Documents/GitHub/redis/devrel-content-crawler/.venv/lib/python3.11/site-packages/redisvl/utils/vectorize/text/huggingface.py", line 103, in _initialize_client
    self._client = SentenceTransformer(model, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Code that threw the error:

    def _get_router(self):
        """Get the singleton router instance"""
        if self._router is None:
            routes = self._create_routes()
            self._router = SemanticRouter(
                name="filter-router",
                vectorizer=HFTextVectorizer(
                    model="sentence-transformers/all-MiniLM-L6-v2",
                    **show_progress_bar=False**
                ),
                routes=routes,
                redis_url="redis://localhost:6379",
                overwrite=True
            )
        return self._router

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions