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

Allow local Spacy Models to be loaded in NLP Engine #1269

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

TSunny007
Copy link
Contributor

@TSunny007 TSunny007 commented Jan 29, 2024

Currently SpacyNlpEngine does not support use of local model paths. This is important for offline/airgapped environments where it is not possible to download spacy model on the fly

Change Description

Follows Spacy's internal logic in .load

if is_package(name):  # installed as package
    465     return load_model_from_package(name, **kwargs)  # type: ignore[arg-type]
    466 if Path(name).exists():  # path to model data directory
    467     return load_model_from_path(Path(name), **kwargs)  # type: ignore[arg-type]

Issue reference

This PR fixes issue #XX

Checklist

  • I have reviewed the contribution guidelines
  • I have signed the CLA (if required)
  • My code includes unit tests
  • All unit tests and lint checks pass locally
  • My PR contains documentation updates / additions if required

Currently `SpacyNlpEngine` does not support use of local model paths. This is important for offline/airgapped environments where it is not possible to download spacy model on the fly
@TSunny007 TSunny007 requested a review from omri374 January 30, 2024 16:57
@omri374
Copy link
Contributor

omri374 commented Jan 30, 2024

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@omri374 omri374 merged commit f24b90d into microsoft:main Feb 1, 2024
26 checks passed
@omri374
Copy link
Contributor

omri374 commented Feb 1, 2024

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants