Skip to content

Problem with loading Morfeusz at MacOS #2

Description

@wojtek11530

I wanted to test your model, but I have not managed to do that on MacOS.

I installed it using the wheel from HuggingFace:

pip install https://huggingface.co/ipipan/pl_nask/resolve/main/pl_nask-any-py3-none-any.whl

Firstly, it lacks morfeusz2 and pexpect and maybe other libs listed in repo requirements.txt so I needed to install it manually.

It goes fine when running using Ubuntu OS.

Unfortunately, I cannot load the model on MacOS (Darwin platform) because there is a wrong signature in loading Morfeusz object:

Traceback (most recent call last):
  File "/Users/wojciech/projects/clusters-topic/src/lemmatizer_run pl.py", line 27, in <module>
    nlp = spacy.load("pl_nask")
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/spacy/__init__.py", line 54, in load
    return util.load_model(
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/spacy/util.py", line 442, in load_model
    return load_model_from_package(name, **kwargs)  # type: ignore[arg-type]
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/spacy/util.py", line 478, in load_model_from_package
    return cls.load(vocab=vocab, disable=disable, enable=enable, exclude=exclude, config=config)  # type: ignore[attr-defined]
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/pl_nask/__init__.py", line 12, in load
    return load_model_from_init_py(__file__, **overrides)
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/spacy/util.py", line 659, in load_model_from_init_py
    return load_model_from_path(
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/spacy/util.py", line 516, in load_model_from_path
    nlp = load_model_from_config(
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/spacy/util.py", line 564, in load_model_from_config
    nlp = lang_cls.from_config(
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/spacy/language.py", line 1819, in from_config
    nlp.add_pipe(
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/spacy/language.py", line 791, in add_pipe
    pipe_component = self.create_pipe(
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/spacy/language.py", line 679, in create_pipe
    resolved = registry.resolve(cfg, validate=validate)
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/confection/__init__.py", line 756, in resolve
    resolved, _ = cls._make(
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/confection/__init__.py", line 805, in _make
    filled, _, resolved = cls._fill(
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/confection/__init__.py", line 877, in _fill
    getter_result = getter(*args, **kwargs)
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/pl_nask/morf.py", line 40, in make_morfeusz
    return Morfeusz(nlp, name, mode=mode, overwrite=overwrite, scorer=scorer)
  File "/Users/wojciech/projects/clusters-topic/.venv/lib/python3.10/site-packages/pl_nask/morf.py", line 51, in __init__
    self.morf = morfeusz2.Morfeusz(expand_tags=True, praet="composite")
TypeError: MorfInterface.__init__() got an unexpected keyword argument 'praet'

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