Skip to content

armgit / dspy

Public Imported from GitHub
0

DSPy: The framework for programming—not prompting—language models

Python

Update finetune.py

Omar Khattab48c6687bf7f1
diff --git a/dspy/teleprompt/finetune.py b/dspy/teleprompt/finetune.py
index 7541bd670..c2357cc78 100644
--- a/dspy/teleprompt/finetune.py
+++ b/dspy/teleprompt/finetune.py
@@ -59,7 +59,7 @@ class BootstrapFinetune(Teleprompter):
def compile(self, student, *, teacher=None, trainset, valset=None,
- target='t5-large', bsize=12, accumsteps=1, lr=5e-5, epochs=1, bf16=False, int8=False, peft=False):
+ target='t5-large', bsize=12, accumsteps=1, lr=5e-5, epochs=1, bf16=False, int8=False, peft=False, path_prefix=None):
# It's usually better to supply a few-shot teacher, rather than uncompiled module (the student).
if teacher is None:
@@ -130,6 +130,9 @@ class BootstrapFinetune(Teleprompter):
'lr': lr
}
+ import os
+ compiler_config['save'] = os.path.join(path_prefix, compiler_config['save']) if path_prefix else compiler_config['save']
+
from dsp.modules.finetuning import finetune_hf
target = target