lag-llama icon indicating copy to clipboard operation
lag-llama copied to clipboard

How to finetune this model

Open zhilif opened this issue 1 year ago • 2 comments

Thanks for releasing this foundation model! I wonder if you have code that demonstrates how to finetune Lag-Llama with custom training data? Thanks!

zhilif avatar Feb 11 '24 23:02 zhilif

coming up after a short recoup! stay tuned. Essentially since its a gluonts Estimator, one should be able to estimator.train() on your data but we need to remove some bespoke fields that were left behind in the lightning callbacks...

kashif avatar Feb 12 '24 15:02 kashif

Yes, as @kashif says, the fine-tuning scripts are coming soon. Scripts to load datasets in custom formats are also coming soon. Thank you for your patience.

ashok-arjun avatar Feb 14 '24 07:02 ashok-arjun

@zhilif have a look at the colab https://colab.research.google.com/drive/1uvTmh-pe1zO5TeaaRVDdoEWJ5dFDI-pA?usp=sharing

kashif avatar Mar 07 '24 20:03 kashif

@kashif thank you for providing the code. Unfortunately, I got this error during fine-tuning:

TypeError: model must be a LightningModule or torch._dynamo.OptimizedModule, got LagLlamaLightningModule

shahrokhvahabi avatar Mar 08 '24 09:03 shahrokhvahabi

@shahrokhvahabi try to git pull, I believe its somehow running an older code

kashif avatar Mar 08 '24 09:03 kashif

@kashif I deleted the lag-llama and cloned again it from the repository. But this error occurred again.

shahrokhvahabi avatar Mar 08 '24 09:03 shahrokhvahabi

@shahrokhvahabi its due to the newer lightning version you have... so try do to:

!pip uninstall -A gluonts
!pip install -U gluonts[torch]

kashif avatar Mar 08 '24 09:03 kashif

@kashif I did but the error is persistent.

shahrokhvahabi avatar Mar 08 '24 10:03 shahrokhvahabi

ah sorry i meant to say:

!pip uninstall -A lightning pytorch-lightning gluonts
!pip install -U gluonts[torch]

kashif avatar Mar 08 '24 10:03 kashif

ah sorry i meant to say:

!pip uninstall -A lightning pytorch-lightning gluonts
!pip install -U gluonts[torch]

Thank you for the reply @kashif . I did as you mentioned above. Could you please give me another suggestion to avoid this error?

shahrokhvahabi avatar Mar 08 '24 10:03 shahrokhvahabi

yeah not sure what more i can do... somehow your setup is sucking in a newer version of lightning

perhaps

!pip install lightning==2.1.4 pytorch-lightning==2.1.4

kashif avatar Mar 08 '24 10:03 kashif

@kashif Could you please send those files in the model you updated so that I can replace them manually?

shahrokhvahabi avatar Mar 08 '24 10:03 shahrokhvahabi

make a new issue instead of hijacking this one as the original author is getting spammed unnecessarily closing this

kashif avatar Mar 08 '24 10:03 kashif