ludwig-ai / ludwig

Low-code framework for building custom LLMs, neural networks, and other AI models
http://ludwig.ai
Apache License 2.0
11.19k stars 1.19k forks source link

Ludwig: Fine-Tune Mistral-7b missing LudwigModel import and/or definition #3884

Closed noahgift closed 10 months ago

noahgift commented 10 months ago

Describe the bug Ludwig: Fine-Tune Mistral-7b missing LudwigModel import and/or definition.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://colab.research.google.com/drive/1i_8A1n__b7ljRWHzIsAdhO7u7r49vUm4#scrollTo=k-dtCIj73498'
  2. Run Cells in cola
  3. Scroll down to 'qlora_fine_tuning_config = yaml.safe_load(' cell and notice LudwigModel not defined
  4. see error

Please provide code, yaml config file and a sample of data in order to entirely reproduce the issue. Issues that are not reproducible will be ignored.

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem. Screenshot 2024-01-16 at 1 19 36 PM

Environment (please complete the following information):

Additional context Add any other context about the problem here.

arnavgarg1 commented 10 months ago

Hey @noahgift - thanks for flagging this issue and sorry you ran into it. I'm taking a look right now and will get back to you once I know what's going on and find a fix.

arnavgarg1 commented 10 months ago

@noahgift I was able to repro and I see the problem - just a few missing imports. Let me update the notebook so that it runs correctly.

noahgift commented 10 months ago

@noahgift I was able to repro and I see the problem - just a few missing imports. Let me update the notebook so that it runs correctly.

Thank you so much! Putting this into a Coursera Duke course on LLMOps!

alexsherstinsky commented 10 months ago

I only just saw this -- did I really not include imports into the notebook? Not sure how this could have happened if it ran fine. In fact, I just checked the original source of this notebook, and all the imports seem to be there (in addition, the references to the notebooks in the blog post also contain the imports). Apologies, @noahgift, for any confusion and lost productivity. Thank you!

arnavgarg1 commented 10 months ago

@alexsherstinsky Thanks for checking! I believe this is a notebook I created a few months ago after our collaboration when Mistral first came out and I may have missed some imports. It was meant to a be a very lean/stripped down version of the original notebook adapted and blogpost we created together, but I adapted it for the code alpaca dataset in conjunction with fine-tuning on Llama-2-7b/13b as can be seen in the Ludwig README.

I'm also surprised that I missed some imports, but I've updated the notebook now to have the right imports! Just making sure that the training parameters are adjusted so that the notebook has good inference performance when it's run!

alexsherstinsky commented 10 months ago

@arnavgarg1 Now I see what is going on! Thank you very much for clarifying! Whew! 😄

arnavgarg1 commented 10 months ago

@noahgift Alright, things should be fixed up! Are you able to give it a try now?

noahgift commented 10 months ago

@noahgift Alright, things should be fixed up! Are you able to give it a try now?

Perfect! Just verified it worked. Appreciate it! Such a great example of why Ludwig is cool. Love anything non-meta as an example!