Skip to content

Add DSL example for LoRA template#33

Merged
rizzip merged 1 commit into
mainfrom
feat/lora-dsl
May 21, 2026
Merged

Add DSL example for LoRA template#33
rizzip merged 1 commit into
mainfrom
feat/lora-dsl

Conversation

@rizzip

@rizzip rizzip commented May 20, 2026

Copy link
Copy Markdown
Contributor

Adds a DSL definition to the LoRA template. Dependent on clarifai-python PR 1044

@rizzip rizzip self-assigned this May 20, 2026
Copilot AI review requested due to automatic review settings May 20, 2026 18:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py defining a single-step training pipeline using clarifai.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")
)
@rizzip
rizzip merged commit 15fe6d2 into main May 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants