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

[BUG] Unexpected keyword argument 'embedding_model' for passage filter module #1042

Closed
rjwharry opened this issue Dec 8, 2024 · 2 comments · Fixed by #1043
Closed

[BUG] Unexpected keyword argument 'embedding_model' for passage filter module #1042

rjwharry opened this issue Dec 8, 2024 · 2 comments · Fixed by #1043
Labels
bug Something isn't working

Comments

@rjwharry
Copy link
Contributor

rjwharry commented Dec 8, 2024

Describe the bug
unexpected keyword argument 'embedding_model' error occurred in passage filter module such as SimilarityThresholdCutoff._pure()

To Reproduce

  1. set embedding_model of similarity_threshold_cutoff in config.yaml
  2. Run autorag

Expected behavior
Succeed

Full Error log
TypeError: SimilarityThresholdCutoff._pure() got an unexpected keyword argument 'embedding_model'

Code that bug is happened
After init cls instance, embedding_model key must be popped from kwargs. But kwargs in BaseModule and SimilarityThresholdCutoff have different id like deep copy.

class BaseModule(metaclass=ABCMeta):
    @classmethod
        def run_evaluator(
            cls,
            project_dir: Union[str, Path],
            previous_result: pd.DataFrame,
            *args,
            **kwargs,
        ):
            instance = cls(project_dir, *args, **kwargs)
            result = instance.pure(previous_result, *args, **kwargs)
            del instance
            return result
class SimilarityThresholdCutoff(BasePassageFilter):
    def __init__(self, project_dir: str, *args, **kwargs):
        super().__init__(project_dir, *args, **kwargs)
        embedding_model_str = kwargs.pop("embedding_model", "openai")
        self.embedding_model = embedding_models[embedding_model_str]()
@rjwharry rjwharry added the bug Something isn't working label Dec 8, 2024
@rjwharry
Copy link
Contributor Author

rjwharry commented Dec 8, 2024

I'm figuring out how to pass kwargs as shallow copy

@rjwharry rjwharry changed the title [BUG] [BUG] Unexpected keyword argument 'embedding_model' for passage filter module Dec 8, 2024
bwook00 added a commit to rjwharry/AutoRAG that referenced this issue Dec 11, 2024
bwook00 added a commit to rjwharry/AutoRAG that referenced this issue Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
@rjwharry and others