-
Notifications
You must be signed in to change notification settings - Fork 13
[refactor] Restructure generation services and etc. #9
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
Conversation
- Move generation directory to `api/python` for better code organization - Refactor image generation service to reuse Python API - Clean up .env.template by removing unused properties and fixing typos - Refactor generation_mode to fetch inference tasks directly from pipeline - Add unload_lora_checkpoint logic - Add offload mode selection in API and `before_generation` - Add docs for python API function signature - Fix lora merge logic
9a502ab to
d156207
Compare
…video`, add lora operations to Python API - Modified `src/cogkit/__init__.py` to updated Python API - Updated `src/cogkit/api/python/generation/(image,video).py` to remove lora param and integrate lora operations - Adjusted `src/cogkit/cli/inference.py` to align with API changes
src/cogkit/cli/inference.py
Outdated
| task = guess_generation_mode(model_id_or_path, task, image_file, video_file) | ||
| dtype = cast_to_torch_dtype(dtype) | ||
| pipeline = load_pipeline(model_id_or_path, transformer_path, dtype) | ||
| task = guess_generation_mode(pipeline=pipeline, image_file=image_file) |
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.
incorrect type: image_file. See the definition of the function guess_generation_mode.
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.
Fixed. PTAL @OleehyO
OleehyO
left a comment
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.
LGTM
api/pythonfor better code organizationguess_generation_modeto fetch inference tasks directly from pipelineunload_lora_checkpointlogicbefore_generation