-
Notifications
You must be signed in to change notification settings - Fork 176
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
Move hivemind.Server from init, streamline imports #441
Conversation
This reverts commit d765c5d.
Codecov Report
@@ Coverage Diff @@
## master #441 +/- ##
==========================================
+ Coverage 83.75% 83.99% +0.24%
==========================================
Files 77 78 +1
Lines 7927 7928 +1
==========================================
+ Hits 6639 6659 +20
+ Misses 1288 1269 -19
|
A working server does 3 things: | ||
- processes incoming forward/backward requests via Runtime (created by the server) | ||
- publishes updates to expert status every :update_period: seconds | ||
- follows orders from HivemindController - if it exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curiously, the doc statement is still technically correct :D
class VorpalSword(SwordBase):
"""A special sword used to kill Jabberwocky - if it exists"""
As far as I remember, this was my wishful thinking. The idea was for HivemindController
to be a class that can change server config over time: add or remove experts, change hyperparameters, stuff like that...
Makes me think how many of these lost dreams we still have in other docstrings :)
This is a chore PR that mainly moves hivemind.Server and related functions into a separate file to keep
server/__init__.py
simple and avoid exposing unintended methods at the top level of the library.Also, I replaced broad
import hivemind
statements with more specific ones in relevant parts of the project to narrow down their scope and avoid possible circular imports in the future.Finally, I moved
generate_uids_from_pattern
toserver.py
, since the refactoring from the first step exposed a circular dependency in the module. This can be improved in the future via better encapsulation of ExpertUID (right now its constants are used all overhivemind.moe
); for now, I believe the solution with a private function is fine.