Add DSL example for LoRA template#33
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Clarifai Pipeline DSL example for the LoRA/Unsloth quick-start template, intended to mirror the existing model-version-train-ps/1/pipeline_step.py behavior and enable bundle generation/upload via the DSL workflow.
Changes:
- Introduces
lora-pipeline-unsloth-quick-start/dsl.pydefining a single-step training pipeline usingclarifai.runners.pipelines. - Adds dynamic loading of the bundled training model class and forwards pipeline inputs into its
train()method. - Includes step metadata (base image, requirements, assets, compute) to generate/upload an executable pipeline bundle.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+12
to
+16
| # Generate a uploadable pipeline bundle: | ||
| python dsl_def.py --generate ./generated-pipeline | ||
|
|
||
| # Or upload directly: | ||
| clarifai pipeline upload dsl_def.py |
Comment on lines
+27
to
+32
| """Load UnslothLoRAVLLM from the asset-bundled models directory. | ||
|
|
||
| Mirrors the dynamic import in model-version-train-ps/1/pipeline_step.py so | ||
| the same logic works both locally and inside the generated step container. | ||
| """ | ||
| models_dir = str(Path(__file__).parent / "models") |
Comment on lines
+37
to
+42
| return next( | ||
| obj | ||
| for name in dir(model_module) | ||
| if isinstance(obj := getattr(model_module, name), type) | ||
| and hasattr(obj, "train") | ||
| ) |
christineyu123
approved these changes
May 20, 2026
3 tasks
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.
Adds a DSL definition to the LoRA template. Dependent on clarifai-python PR 1044