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

Fixed the "no attribute" error from #536 #552

Merged
merged 1 commit into from
Nov 5, 2021
Merged

Fixed the "no attribute" error from #536 #552

merged 1 commit into from
Nov 5, 2021

Conversation

agv7
Copy link
Contributor

@agv7 agv7 commented Oct 22, 2021

What does this PR do?

This change fixes "AttributeError: module 'textattack' has no attribute 'shared'" as shown by issue 536 here: #536

Summary

Before this PR, users were running into the problem of "AttributeError: module 'textattack' has no attribute 'shared'" whenever they were running the part_of_speech.py file. This PR uses the same logic from #551 which solves the problem of the attribute not belonging to the module using a direct import of the module.

Additions

  • The line "from textattack.shared.utils import LazyLoader, device" has been added.

Changes

  • Changed "flair.device = textattack.shared.utils.device" to be "flair.device = device"
  • Changed "stanza = textattack.shared.utils.LazyLoader("stanza", globals(), "stanza")" to be "stanza = LazyLoader("stanza", globals(), "stanza")"

Checklist

  • The title of your pull request should be a summary of its contribution.
  • Please write detailed description of what parts have been newly added and what parts have been modified. Please also explain why certain changes were made.
  • If your pull request addresses an issue, please mention the issue number in the pull request description to make sure they are linked (and people consulting the issue know you are working on it)
  • To indicate a work in progress please mark it as a draft on Github.
  • Make sure existing tests pass.
  • Add relevant tests. No quality testing = no merge.
  • All public methods must have informative docstrings that work nicely with sphinx. For new modules/files, please add/modify the appropriate .rst file in TextAttack/docs/apidoc.'

This change fixes "AttributeError: module 'textattack' has no attribute 'shared'", as shown here: #536
@agv7 agv7 mentioned this pull request Oct 22, 2021
1 task
@qiyanjun
Copy link
Member

qiyanjun commented Nov 3, 2021

@Hanyu-Liu-123 can you review this too? thanks

@qiyanjun qiyanjun marked this pull request as ready for review November 3, 2021 14:32
@qiyanjun qiyanjun merged commit e6f9c56 into QData:master Nov 5, 2021
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