feat: worker abstractions; fix: various improvements and bug fixes#328
Merged
feat: worker abstractions; fix: various improvements and bug fixes#328
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
a2a6db0 to
27e6932
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
055117e to
60350da
Compare
d12fced to
6d44d18
Compare
This includes scenarios where, for example, JobIDs and WorkerIDs.
This more accurately reflects the usage of this field type fix: rename `job_id` vars to `gen_id`
`object` and `any` have distinct meanings. particularly, I do in fact mean "any" here rather than expecting an object compatible with `object`
`id_factory`, `default_testing_image_bytes`, `default_testing_image_PIL`
- Fixes the `SharedKeyCreateRequest` class to use the `PUT` method instead of `POST`. - A new mixin class, `MessageSpecifiesSharedKeyMixin` - Accordingly updates the api <-> sdk map json - Adds a warning when shared keys are empty (probably unintended but still useful for testing) docs: add missing shared keys mkdocs stub
The `time_constructed` property is the time at which the model is constructed and will be used to infer pop times if not otherwise specified for jobs. It may also serve some purpose with testing and/or debugging.
Unordered indents were locally configured to lint as 2-space, which mkdocs does not support.
This more accurately reflects that they are simply the well defined and known to the SDK types. "Any" implies a generic (child class) relationship which these type aliases do not actually encapsulate.
Due to the evolution of the design of the sdk, most of the usages of the `generation_id`(s) variables were confusingly named. In the current iteration, `generations` are instances of inference (or generating) , where `results` are the actual outputs from those. There can be 1...N results, but generations are always a single, discrete, entity from the perspective of the SDK.
This closes a gap in testing where if an endpoint was supported in the SDK by any verb, but not all verbs, testing would still pass. This was specifically in response that a newly added DELETE verb to a previously existing endpoint (`/users/`) did not cause the testing to fail.
…pdates - A substantial rework of the job/generation systems, their semantic meanings, and improved their separation of responsibilities - Introduces backend_parsing modules and example worker generation scripts. - Updates API payload/response maps and field descriptions for user endpoints, including support for user deletion and undeletion. - Enhances documentation with backend values mapper and client design guides, - Reworks package structure - Improves many test methodologies, and adds tests for new/changed modules/classes
- Uses python 3.12+ typing features to better define the relationships for generations and jobs, especially when generics/generic parameters. - Adjust the logging system for logfire - Also includes a number of ruff lint fixes
- Fixes docstring test to properly identify and correct docstrings for API models - Fixes missing docstrings in API models
8e377ed to
517a6e8
Compare
d92eeaa to
2d88b17
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces new features (mostly around generation/worker abstractions), refactors core SDK structures, expands endpoint support, improves testing and documentation, and fixes a range of issues across API models, naming, logging, and compatibility.
Features
MessageSpecifiesSharedKeyMixintime_constructedproperty toHordeResponsegeneration_parametersnamespace for backend-agnostic parameter modelsHordeSingleGenerationsupport_async_client_exceptionsstandardization in SDK namespacefirst_pass_resolutioncalc_upscale_sampler_stepsbase64_str_to_pil_imageload_large_modelsargument in model_meta (for worker model choices)Refactoring
JobID→GenerationIDand related variables (job_id→gen_id)generation_ids→result_idsgen._params/*/consts.pyai_horde_worker→workerrequests.request(...)additional_paramsFixes
model_)PUTvsPOST)ssl_contextnot passed in async clientNoValidRequestFoundskipped,_time_constructed)typing_extensionswhere required__init__.pyfilesTests
id_factory, image fixtures, job fixtures)dynamic_json_loadconftestDocumentation
JobID→GenerationID)CI / Build / Tooling
tach)Chores / Style
Notes