You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I get a WordNetCorpusReader to have no attribute LazyCorpusLoader when a endpoint is hit seconds after server starts.
If a request is made seconds after the server has started that error pops up when using bonn inside gunicorn server.
The LazyCorpusLoader is like a placeholder that stands in for the actual data until it’s fully loaded. It’s used to avoid loading huge corpora into memory right away. When you first use it, it switches from being a placeholder to the real data object you need.
The real object you need WordNetCorpusReader hasn't loaded when the server is ready to make the call hence the error.
Steps to Reproduce
Start my app.
Setup logging.
Initialize a server using FastApi with a lifespan method.
lifespan is an asyncronus context manager method which, among other things, initializes category manager controller with a fifu_file and settings. I've attached a code_block with my server.
Make a request 3-5 seconds after server is up.
Get an the above mentioned error.
Expected Behavior
It's expected for the category_manager to have loaded.
Actual Behavior
Get an error WordNetCorpusReader to have no attribute LazyCorpusLoader
I have reviewed existing issues and confirmed that this issue has not been logged before.
I have provided minimal example of expected vs actual behavior.
Note: Please make sure to check if there is already an existing issue similar to yours before submitting a new one. If you find an existing issue,
you can comment on it to provide additional information or to show that you are experiencing the same problem.
The text was updated successfully, but these errors were encountered:
KamenDimitrov97
changed the title
🐛 WordNetCorpusReader to have no attribute LazyCorpusLoader
🐛 WordNetCorpusReader has no attribute LazyCorpusLoader
Aug 13, 2024
I've managed to fix the issue by catching the error, logging an exception and trying again in the same method.
Since the first time WordNetCorpusReader is being called it's a LazyCorpusLoader who's in the process of converting into a WordNetCorpusReader so if you call it once you'll get the error WordNetCorpusReader to have no attribute LazyCorpusLoader
but the second time it'll work as intended.
I'm starting to work on ensuring that the stopwords WordListCorpusReader and the wn WordNetCorpusReader is loaded.
Issues is we don't load it ourselves it's being called in the WornetLemmetizer.
Issue Summary
I get a
WordNetCorpusReader to have no attribute LazyCorpusLoader
when a endpoint is hit seconds after server starts.If a request is made seconds after the server has started that error pops up when using bonn inside gunicorn server.
The LazyCorpusLoader is like a placeholder that stands in for the actual data until it’s fully loaded. It’s used to avoid loading huge corpora into memory right away. When you first use it, it switches from being a placeholder to the real data object you need.
The real object you need
WordNetCorpusReader
hasn't loaded when the server is ready to make the call hence the error.Steps to Reproduce
Expected Behavior
It's expected for the category_manager to have loaded.
Actual Behavior
Get an error
WordNetCorpusReader to have no attribute LazyCorpusLoader
Environment
Possible Solution
Resources used: stack overflow similar issue
Checklist
Note: Please make sure to check if there is already an existing issue similar to yours before submitting a new one. If you find an existing issue,
you can comment on it to provide additional information or to show that you are experiencing the same problem.
The text was updated successfully, but these errors were encountered: