Skip to content
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

[Bug] Not gettting of output_dir from train_kwargs in dsp/dspy/clients/lm_local.py #7767

Open
rubensmau opened this issue Feb 5, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@rubensmau
Copy link

What happened?

When running https://dspy.ai/tutorials/classification_finetuning/ inside Google Colab, Line:
classify_ft = optimizer.compile(student_classify, teacher=teacher_classify, trainset=unlabeled_trainset)

got error:

[BootstrapFinetune] Preparing the student and teacher programs...
[BootstrapFinetune] Bootstrapping data...
Average Metric: 500.00 / 500 (100.0%): 100%|██████████| 500/500 [00:04<00:00, 115.30it/s]2025/02/05 21:40:32 INFO dspy.evaluate.evaluate: Average Metric: 500 / 500 (100.0%)

[BootstrapFinetune] Preparing the train data...
[BootstrapFinetune] Using 500 data points for fine-tuning the model: openai/local:meta-llama/Llama-3.2-1B-Instruct
[BootstrapFinetune] Starting LM fine-tuning...
[BootstrapFinetune] 1 fine-tuning job(s) to start
[BootstrapFinetune] Starting 1 fine-tuning job(s)...
[Local Provider] Data saved to /root/.dspy_cache/finetune/4bec8714ae43838b.jsonl
[Local Provider] Starting local training, will save to /root/.dspy_cache/finetune/4bec8714ae43838b__meta-llama__Llama-3.2-1B-Instruct
Using device: cuda
Adding pad token to tokenizer
Creating dataset
Map: 100%
 500/500 [00:00<00:00, 2403.78 examples/s]
2025/02/05 21:40:57 ERROR dspy.clients.lm: name 'output_dir' is not defined

It seems to me that the problem is in dsp/dspy/clients/lm_local.py
it is missing in the code, in line 180:
output_dir = train_kwargs.get("output_dir", None)

Steps to reproduce

run notebook

DSPy version

2.6.2

@rubensmau rubensmau added the bug Something isn't working label Feb 5, 2025
@okhat
Copy link
Collaborator

okhat commented Feb 6, 2025

Hey yes we have a PR #7629 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants