Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use evaluate or fit methods on HybridRouter #492

Open
thepowerfulwoz opened this issue Dec 23, 2024 · 2 comments
Open

Cannot use evaluate or fit methods on HybridRouter #492

thepowerfulwoz opened this issue Dec 23, 2024 · 2 comments
Assignees
Labels
feature New feature request

Comments

@thepowerfulwoz
Copy link

With the recent changes that add inheritance to the different routers, using the evaluate method throws

File "C:\Users\User\AppData\Local\miniforge3\envs\semanticRouter\lib\site-packages\semantic_router\routers\base.py", line 1214, in fit
    best_acc = self._vec_evaluate(Xq=np.array(Xq), y=y)
  File "C:\Users\User\AppData\Local\miniforge3\envs\semanticRouter\lib\site-packages\semantic_router\routers\base.py", line 1258, in _vec_evaluate
    route_choice = self(vector=xq, simulate_static=True)
  File "C:\Users\User\AppData\Local\miniforge3\envs\semanticRouter\lib\site-packages\semantic_router\routers\hybrid.py", line 215, in __call__
    raise ValueError("Either text or sparse_vector must be provided")
ValueError: Either text or sparse_vector must be provided

This is because the __call__ method requires either text or sparse vector, but _vec_evaluate calls it with self(vector=xq, simulate_static=True)

Is there a fix in the works for this?

@jamescalam
Copy link
Member

we didn't add support for eval and fit for HybridRouter yet — but I will prioritize

@jamescalam jamescalam self-assigned this Dec 23, 2024
@jamescalam jamescalam added the feature New feature request label Dec 23, 2024
@thepowerfulwoz
Copy link
Author

Wonderful Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

2 participants