The EASIEST way to finetune LLAMA-v2 on local machine!

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2024
  • In this video, I'll show you the easiest, simplest and fastest way to fine tune llama-v2 on your local machine for a custom dataset! You can also use the tutorial to train/finetune any other Large Language Model (LLM). In this tutorial, we will be using autotrain-advanced.
    AutoTrain Advanced github repo: github.com/hug...
    Steps:
    Install autotrain-advanced using pip:
    - pip install autotrain-advanced
    Setup (optional, required on google colab):
    - autotrain setup --update-torch
    Train:
    autotrain llm --train --project_name my-llm --model meta-llama/Llama-2-7b-hf --data_path . --use_peft --use_int4 --learning_rate 2e-4 --train_batch_size 12 --num_train_epochs 3 --trainer sft
    If you are on free version of colab, use this model instead: huggingface.co.... This is a smaller sharded version of llama-2-7b-hf by meta.
    Please subscribe and like the video to help me keep motivated to make awesome videos like this one. :)
    My book, Approaching (Almost) Any Machine Learning problem, is available for free here: bit.ly/approac...
    Follow me on:
    Twitter: / abhi1thakur
    LinkedIn: / abhi1thakur
    Kaggle: kaggle.com/abh...

ความคิดเห็น • 300

  • @linuxmanju
    @linuxmanju 8 หลายเดือนก่อน +32

    Anyone comes across this in 2024 (jan ), the command switches with new autotrain version is autotrain llm --train --project-name josh-ops --model mistralai/Mistral-7B-Instruct-v0.2 --data-path . --use-peft --quantization int4 --lr 2e-4 --train-batch-size 12 --epochs 3 --trainer sft . Great, Video, thanks Abhishek

    • @BrusnickiRoberto
      @BrusnickiRoberto 7 หลายเดือนก่อน

      After finetuning it, how to run it?

    • @vinodb4339
      @vinodb4339 3 หลายเดือนก่อน

      ​@@BrusnickiRobertoHey hi did you run it??

    • @BrusnickiRoberto
      @BrusnickiRoberto 3 หลายเดือนก่อน

      @@vinodb4339 no

  • @andyjax100
    @andyjax100 5 หลายเดือนก่อน

    Keeping it this simple is something very few people are able to do. Very well explained.
    This can be understood by even a beginner. Atleast the execution if not the intuition behind it. Kudos

  • @AICoffeeBreak
    @AICoffeeBreak ปีที่แล้ว +12

    Amazing, tutorials at light speed! Llama 2 was just released! 😮

  • @fercho524-main
    @fercho524-main 2 วันที่ผ่านมา

    Great tool, it works for my small dataset (248 rows) and i trained it in a rtx 3060 with 12G :)

  • @tarungupta83
    @tarungupta83 ปีที่แล้ว +5

    Appreciate it, and request to continue making such videos🎉

  • @tarungupta83
    @tarungupta83 ปีที่แล้ว +4

    That's Awesome, nothing better than this way of training large language model. Super easy ❤

  • @WeDuMedia
    @WeDuMedia 5 หลายเดือนก่อน

    Incredibly helpful video, I appreciate that you took the time to create this! Great stuff

  • @YuniYoshi
    @YuniYoshi 10 หลายเดือนก่อน +1

    There is only one thing I want to see. I want to see you using the final result and prove it actually works. Thank you.

  • @elmuchoconrado
    @elmuchoconrado ปีที่แล้ว +7

    As always very useful and short without wasting anyone's time. Thank you. Just I'm a bit confused about the prompt formatting you have used here - "### Instruction:
    ### Input:... etc" while Llama official is "[INST] {{ system_prompt }}{{ user_message }} [/INST]" and on TheBloke's page it says "SYSTEM: {system_prompt}
    USER: {prompt}
    ASSISTANT:"

    • @ahmetekizx
      @ahmetekizx 10 หลายเดือนก่อน

      I think this isn't mandatory, it is a suggestion.

  • @syedshahab8471
    @syedshahab8471 ปีที่แล้ว +2

    Thank you for the on-point tutorial.

  • @aaronliruns
    @aaronliruns ปีที่แล้ว +7

    Great tutorial! Can you also put up one video teaching on how to merge the fine tuned weights to the base model and do inference? Would like to see an end-to-end course. Thank you!

    • @adamocheri3513
      @adamocheri3513 ปีที่แล้ว +2

      +1 on this question !!!!

    • @devyanshrastogi
      @devyanshrastogi 10 หลายเดือนก่อน

      any updates guys?? I really want to know how to merge the fine tuned model with the base model and do the inference. Do let me you have any resources or insights about the same

    • @kopamed5024
      @kopamed5024 8 หลายเดือนก่อน

      @@devyanshrastogi also need this answered. have you guys had any success?

  • @charleskarpati1129
    @charleskarpati1129 9 หลายเดือนก่อน

    Thank you Abhishek! This is phenomenal.

  • @MasterBrain182
    @MasterBrain182 ปีที่แล้ว +1

    Astonishing content Man 🔥🔥🔥 🚀

  • @dhruvilshah7770
    @dhruvilshah7770 6 หลายเดือนก่อน +1

    Can you make a video for fine tuning in silicon macs ?

  • @xthefoetusx
    @xthefoetusx ปีที่แล้ว +3

    Great video! Would be great if in some future vid you could go into depth on the training hyperparameters and perhaps also talk about what size your custom datasets should be.

    • @abhishekkrthakur
      @abhishekkrthakur  ปีที่แล้ว +4

      sometimes I do that. however, this model would have taken wayy too long to train. im training a model as i type here and if i get good results ill share both model and params 🙂

    • @emrahe468
      @emrahe468 ปีที่แล้ว +1

      @@abhishekkrthakur guess no good luck with the training :(

  • @bryanvann
    @bryanvann ปีที่แล้ว +18

    Thanks for the tutorial! A couple questions for you. Is there an approach you're using to test quality and verity that the training data has influenced the weights in the model sufficiently to learn the new task? And second, can you use the same approach for unstructured training data such as using a large corpus of private data to do domain adaptation?

  • @ajaytaneja111
    @ajaytaneja111 ปีที่แล้ว +4

    Hi Abhishek, is the auto train using LORA or prompt tuning as the PEFT technique?

  • @am0x01
    @am0x01 8 หลายเดือนก่อน +1

    In my experiment, it not create the [config.json] what am I doing wrong?

  • @sandeelg_lite
    @sandeelg_lite ปีที่แล้ว +1

    I trained model using autotrain in same way as you suggested and model file is stored.
    Now I need to use this model for prediction. Can you shed some light on this as well?

  • @anantkabra6825
    @anantkabra6825 10 หลายเดือนก่อน +1

    Hello I am getting this error can someone please help me out with it: ValueError: Batch does not contain any data (`None`). At the end of all iterable data available before expected stop iteration.

  • @stevenshaw124
    @stevenshaw124 ปีที่แล้ว +3

    what kind of GPUs do you have? how big was your dataset and how long did it take to train? what is the smallest fine-tuning data set size that would be reasonable?

  • @chichen8425
    @chichen8425 5 หลายเดือนก่อน

    I know it could be too much but could you also make a video of how to prepare the data? I have like 'question' and 'answer' but I am strugging to make it to a trainable data set into that kind of csv so I could use it!

  • @manishsharma2211
    @manishsharma2211 ปีที่แล้ว

    The way Abhishek side eyes before stopping the video and resuming is is soo crazy 🤣🤣😅

  • @mautkajuari
    @mautkajuari ปีที่แล้ว

    Informative video, hopefully one day I will get a task that requires me to finetune a LLM

  • @nirsarkar
    @nirsarkar ปีที่แล้ว

    Excellent, thank you so much. I will try.

  • @rajhammeersinghhada72
    @rajhammeersinghhada72 8 หลายเดือนก่อน

    Why do we need --mixed-precsion and --quantization both? Aren't they both doing the same thing?

  • @jdoejdoe6161
    @jdoejdoe6161 ปีที่แล้ว +3

    Please show how you used the trained mode for inference

  • @FlyXing16
    @FlyXing16 ปีที่แล้ว

    Thanks Kaggle grand master :) you got an channel.

  • @prachijadhav9098
    @prachijadhav9098 ปีที่แล้ว +2

    Nice video Abhishek!
    I am curious to know about custom data for LLMs. What is the ideal (good quality) data size (e.g., #rows), to fine-tune these models for good performance, not necessarily it should be big data of course.
    Thanks!

  • @YuniYoshi
    @YuniYoshi 10 หลายเดือนก่อน

    One other comment. The data you showed looks randomly organized and I don't understand how it's a CSV at all. The top part has some column names and data below is not following it at all. What is going on?

  • @emrahe468
    @emrahe468 ปีที่แล้ว +1

    On text column you formatted the data as ### Instruction: and ### Response:
    Some use ### Human and ### Assistant :
    How will autotrain will understand these custom formats?? Also how will it decide to read train.csv when we just --data_path . ???

    • @abhishekkrthakur
      @abhishekkrthakur  ปีที่แล้ว +1

      doesnt matter what format you use as long as you use the same format during inference

    • @emrahe468
      @emrahe468 ปีที่แล้ว

      ​@@abhishekkrthakurty for the reply. Can you show/link this inference setup from any of your videos / our from others' ?

    • @devyanshrastogi
      @devyanshrastogi 10 หลายเดือนก่อน

      Do let me know if you found any update regarding the same

  • @tachyon7777
    @tachyon7777 ปีที่แล้ว

    Great one! Two things - you didn't show how to configure the cli to enable access to the model. Secondly, it would be useful to know how to use aws for training. Thanks!

  • @_Zefyr_
    @_Zefyr_ 11 หลายเดือนก่อน +1

    Hi I have a question , it´s posible to use "autotrain" without cuda, with rocm support of AMD GPU ?

  • @sohailhosseini2266
    @sohailhosseini2266 ปีที่แล้ว

    Thanks for sharing!

  • @aiwesee
    @aiwesee ปีที่แล้ว +1

    For fine-tuning of the large language models (llama-2-13b-chat), what should be the format(.text/.json/.csv) and structure (like should be an excel or docs file or prompt and response or instruction and output) of the training dataset? And also how to prepare or organise the tabular dataset for training purpose?

  • @laurayang8893
    @laurayang8893 ปีที่แล้ว +1

    Can I try your code on Mac M2 ( 64GB memory)? Thank you!

    • @nirsarkar
      @nirsarkar ปีที่แล้ว

      even I was looking for Mac M2, I have only 24G

  • @abdalgaderabubaker6078
    @abdalgaderabubaker6078 ปีที่แล้ว +2

    Any idea to fine-tune it on Apple chip M1/M2? Just have an installation issues with auto train-advanced 😢

    • @allentran3357
      @allentran3357 ปีที่แล้ว

      Would love to know how to do this as well!

    • @jas5945
      @jas5945 ปีที่แล้ว +1

      Bumping because running into so many issues with M1. Cannot believe how little resources are available for M1 right now given that macOS is so widely used in data science

  • @muhammadasadullah4452
    @muhammadasadullah4452 11 หลายเดือนก่อน

    Great work Abhishek Thakur, it will be great if you made a video on how to run the fine-tuned model

    • @abhishekkrthakur
      @abhishekkrthakur  11 หลายเดือนก่อน

      already done. check out other videos on my channel

    • @AnandMoorthyJ
      @AnandMoorthyJ 11 หลายเดือนก่อน

      @@abhishekkrthakur can you please post the video link? there are many videos in your channel, it's hard to find which one you are talking about.

    • @devyanshrastogi
      @devyanshrastogi 10 หลายเดือนก่อน

      ​@@abhishekkrthakur I did fine tuning on the model, but I don't think I can run it on google colab with T4 since its show out of memory error!! Any suggestion?

    • @ozzzer
      @ozzzer 5 หลายเดือนก่อน

      @@AnandMoorthyJ did you find the video? im looking for the link aswell :)

    • @vinodb4339
      @vinodb4339 3 หลายเดือนก่อน

      ​@@AnandMoorthyJare you able to run it??
      Did you find the video link?

  • @jessem2176
    @jessem2176 ปีที่แล้ว

    Great Video. i love it and can't wait to try it. Now that Llama2 is out... is it better to FineTune a model or try to create your own Model?

  • @ConsultingjoeOnline
    @ConsultingjoeOnline 6 หลายเดือนก่อน

    How do you convert it to work with Ollama? I setup the model file and it doesnt seem to know anything from my training.

  • @srinivasanm48
    @srinivasanm48 5 หลายเดือนก่อน

    When will I be able to see the model that I have trained? Once all the training is complete?

  • @ChristianKalla
    @ChristianKalla ปีที่แล้ว +1

    Do you have to use [INST]...[/INST] for indicating the instructions? I think the original Llama 2 model was trained with these tags, so I am a bit puzzled if you have to use the tags in the csv or they are added internally ?!

    • @abhishekkrthakur
      @abhishekkrthakur  ปีที่แล้ว

      in this video, im finetuning the base model. you can finetune it anyway you want. you can even take the chat model and finetune it this way. if you are using a different format for finetuning, you must use the same format while inference in order to get the best results.

  • @utoubp
    @utoubp 8 หลายเดือนก่อน

    Hi Abhishek,
    Much appreciated. How would things change if we were to use simple fine tuning? That is, just a large single code file to learn from, to tune code-llama, phi2, etc..

  • @abramswee
    @abramswee ปีที่แล้ว

    thanks for sharing!

  • @crimsonalchemist856
    @crimsonalchemist856 ปีที่แล้ว +1

    Hey Abhishek, Thanks for sharing this amazing tutorial. Can I do this on my RTX 3070Ti 8GB GPU? If yes, what batch size would be preferable?

    • @abhishekkrthakur
      @abhishekkrthakur  ปีที่แล้ว +2

      8GB sounds a bit low for this. maybe try bs=1 or 2? but tbh, im not sure if it will work. Might work fine for a smaller model!

  • @何骁-q9q
    @何骁-q9q 7 หลายเดือนก่อน

    nice video. it great for a beginner to learn how to fine tune LLAMA2 locally. It would be better if you can share the code and dataset.

  • @saw6053
    @saw6053 ปีที่แล้ว

    Got it to work in Ubuntu WSL:
    Have Conda installed..
    1 apt-get update && apt-get upgrade -y
    2 conda update --all
    3 apt install nvidia-cuda-toolkit
    4 conda create -n train python==3.10
    5 conda activate train
    6 pip install autotrain-advanced
    7 autotrain setup --update-torch
    8 conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.7 -c pytorch -c nvidia
    9 apt install build-essential
    10 pip install cchardet

  • @boujlidamohamed
    @boujlidamohamed ปีที่แล้ว +1

    First thank you for the great tutorial , I have one question : I am trying to finetune the model on Japanese , do you have any advice for that ? I have tried the same script as you did but it didn't work; it produced some gibberish after the training finished , I am guessing it is a tokenizer problem, what do you think ?

  • @deltagamma1442
    @deltagamma1442 ปีที่แล้ว +1

    How do you set the training data? I see different people using different formats? Does it matter or is the only requirement that it has to be structured meaniningfully?

  • @jdoejdoe6161
    @jdoejdoe6161 ปีที่แล้ว +1

    Hi Abh
    Your method is inspiring and commendable. How do we read the csv or json training dataset we prepared instead of the hugging face dataset you used?

  • @ravigarimella3166
    @ravigarimella3166 ปีที่แล้ว +1

    I am getting a "No GPU found. Please install CUDA and try again." Even after Installing CUDA I am getting this error. When I check with nvcc -V I get NVIDIA Cuda Compiler Driver message. Is there an issue with the path?

    • @satyamgupta2182
      @satyamgupta2182 11 หลายเดือนก่อน

      did you come across a solution @ravigarimella3166

  • @cloudsystem3740
    @cloudsystem3740 ปีที่แล้ว

    thank you very much

  • @as-kw8dt
    @as-kw8dt 3 หลายเดือนก่อน

    If there are a multiple input values how that have to be inserted in the cvs data ?

  • @JagadishSongapagounder
    @JagadishSongapagounder ปีที่แล้ว +1

    Great Job :)

  • @jas5945
    @jas5945 ปีที่แล้ว +1

    Very good tutorial. On what machine are you running this? I am trying to run it on a Macbook pro M1 but I keep getting "ValueError: No GPU found. Please install CUDA and try again." I have tried to do this directly on Huggingface and got "error 400: bad request"...so I cloned autotrain and ran it locally...still getting error 400. Do you have any pointers?

    • @nirsarkar
      @nirsarkar ปีที่แล้ว

      Same error

  • @jeremyarancio1683
    @jeremyarancio1683 ปีที่แล้ว

    Nice vid
    Should we label input tokens to -100 to focus the training on the prediction?
    I see no one doing it

  • @returncode0000
    @returncode0000 ปีที่แล้ว

    I just bought a RTX 4090 Founders Edition. Could you tell on a particular example were I could run into limits with card when training LLMs locally? I personally think that I'm safe for the next few years and I will not run in any problems.

  • @StEvUgnIn
    @StEvUgnIn 8 หลายเดือนก่อน

    I did the same with LLama-2, but --push_to_hub doesn't push at all.

  • @spotnuru83
    @spotnuru83 2 หลายเดือนก่อน

    this is really great appreciate it, but i always face problem in installations, like i tried to install pip install autotrain-advanced and i am getting error aas could not build wheels for pycocotools , here are the steps i performed i created a new environment and installed pandas and then this autotrain-advanced installation .. and its failing, if you can help that will be great.. thanks in advance

    • @spotnuru83
      @spotnuru83 2 หลายเดือนก่อน

      I found the solution and was able to move forward, but now when i am trying to train it is saying that it is a gated repo and needs permission, there was a form and i submitted the data, any idea by when i will be getting the permission, do they give to everyone or what is the possibility here? also can i do the same with ollama otherwise? as i feel it might be easy with ollama.. kindly help here. thanks in advnace.

  • @AgentDR-e5u
    @AgentDR-e5u ปีที่แล้ว +1

    Amazing content. One Q left: how can I run the model locally in inference mode after training? Anyone have a command for that?

    • @abhishekkrthakur
      @abhishekkrthakur  ปีที่แล้ว +1

      th-cam.com/video/o1BCq1KJULM/w-d-xo.html

  • @vasuchandra
    @vasuchandra ปีที่แล้ว

    Thanks for the tutorial.
    On a Linux 5.15.0-71-generic #78-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux machine, I get following error when training llm with the small dataset. File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 2819, in from_pretrained
    raise ValueError(
    ValueError:
    Some modules are dispatched on the CPU or the disk. Make sure you have enough GPU RAM to fit
    the quantized model. If you want to dispatch the model on the CPU or the disk while keeping
    these modules in 32-bit, you need to set `load_in_8bit_fp32_cpu_offload=True` and pass a custom
    `device_map` to `from_pretrained`.
    What could be the problem? Is it possible to share the data.csv that you have with single row that I can take as reference to test my own data?

  • @kunalpatil7705
    @kunalpatil7705 ปีที่แล้ว

    Thanks for the video. i have a doubt that how can i make a package of it so others can also use it offline by just installing the application

  • @oliversilverstein1221
    @oliversilverstein1221 ปีที่แล้ว

    hello, thank you. i really need to know: does this pad appropriately? also, how does it internally split it into prompt completion? Can i make up roles like ### System? does it complete only the last message?

  • @DevanshiSukhija
    @DevanshiSukhija ปีที่แล้ว

    How is your ipython giving suggestions? I want the same set up. Please make a video on these types of set up that assists in coding and other processes.

  • @DavidJones-cw1ip
    @DavidJones-cw1ip ปีที่แล้ว +1

    Any chance you have the python scripts available somewhere? Thanks in advance.

  • @Sanguen666
    @Sanguen666 ปีที่แล้ว

    where is the load dataset part in ur code and in the jupyter notebook? did u even bother testing it b4 publishing?

  • @jaivalani4609
    @jaivalani4609 ปีที่แล้ว

    Thank you ,what is diff between instruction and input

  • @satyamgupta2182
    @satyamgupta2182 11 หลายเดือนก่อน

    Hello,
    Thank you for this video.
    Can we run this on mac, though?
    I ask because my training data is confidential and I don't want to risk it with cloud. I have access to a m2 ultra mac studio though

  • @safaelaqrichi9096
    @safaelaqrichi9096 ปีที่แล้ว

    Thank you for this interesting video. How could we change the encoding to ''latin-1' in order to train on french language ? thank you.

  • @rohitdaddekar2900
    @rohitdaddekar2900 ปีที่แล้ว

    Hey, could you guide us how to train custom dataset on llama2? How to prepare our dataset for training?

  • @deepakkrishna837
    @deepakkrishna837 10 หลายเดือนก่อน

    Hi when we tried fine tuning MPT LLM using autotrain, getting the error ValueError: MPTForCausalLM does not support gradient checkpointing. Any help you can offer on this pleas?

  • @unclecode
    @unclecode ปีที่แล้ว +1

    Beautiful content, I have a side question, what tool you are using to have "copilot"-like suggestion in your terminal? Thx again for the video

    • @jessem2176
      @jessem2176 ปีที่แล้ว

      I use Hugginfaces co pilot. - it works pretty well and super easy to set up and free..

    • @ahmetekizx
      @ahmetekizx 11 หลายเดือนก่อน

      @@jessem2176 Thanks for the recommendation, but did you mean HuggingFace Personal-copilot Blog?

  • @govindarao4348
    @govindarao4348 ปีที่แล้ว

    when i am using this command pip install autotrain-advanced getting errors
    error: subprocess-exited-with-error
    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: subprocess-exited-with-error

  • @manojreddy7618
    @manojreddy7618 ปีที่แล้ว

    Thank you for the video. I am new to this, so I am trying to set it up on my windows PC. When I am trying to install the latest version of autotrain-advanced==0.6.2, I get an error saying: trition==2.0.0.post1 cannot be found. Which I believe is only available on Linux. So is it possible to use autotrain-advanced on windows?

  • @nehabidkar7377
    @nehabidkar7377 ปีที่แล้ว

    Thanks for this great explanation. Can you provide the link to you training data?

  • @oxydol3456
    @oxydol3456 4 หลายเดือนก่อน

    which machine is recommended for fine-tuning LLAMA? windows?

  • @dr.mikeybee
    @dr.mikeybee 10 หลายเดือนก่อน

    Nice job!

  • @mariusirgens5555
    @mariusirgens5555 ปีที่แล้ว

    Superb video! Does autotrain allow to export finetuned model as GGML file? Or can it be used with GGML file?

  • @abdellaziztekaya8596
    @abdellaziztekaya8596 8 หลายเดือนก่อน

    Where can i find to code you worte and your dataset? I would like to use it as an exemple for testing

  • @r34ct4
    @r34ct4 ปีที่แล้ว

    Thanks for the comprehensive tutorial. Can this be done using chat logs to build a clone of your friend? I have done this with GPT3.5 finetuning using prompt->response. The prompts are questions generated by ChatGPT based on the chat log message. Can the same thing be done with Instruction->Input->Response? Thank you very much man.

  • @tal7atal7a66
    @tal7atal7a66 6 หลายเดือนก่อน

    thanks bro ❤

  • @cesarsantosvisballambis5469
    @cesarsantosvisballambis5469 ปีที่แล้ว

    Hi , nice tutorial, could you please help me with this error ? , when I try to train the model I got this error : raise ValueError("No GPU found. Please install CUDA and try again.") , Do you know how to solve this ?

  • @ezzye
    @ezzye ปีที่แล้ว

    "These days", LOL. We should all be training our own LLMs.

  • @edatrero
    @edatrero ปีที่แล้ว

    Thanks!

  • @alexchow9629
    @alexchow9629 ปีที่แล้ว +47

    Deceptive use of the term “fine tuning”. What you’re doing here isn’t fine tuning. It’s “many-shot” learning in the prompt.

    • @iamfury2k275
      @iamfury2k275 ปีที่แล้ว +3

      I thought that too from the title as fine tuning required very powerful hardware... What this person did is in my opinion instruction fine tuning. Please share your thoughts I love discussion

    • @abhishekkrthakur
      @abhishekkrthakur  ปีที่แล้ว +13

      correct me if im wrong but from what i understand, this is fine-tuning as we are using an entirely different dataset and have re-formatted the instructions, training the model to perform chat task and not classical text generation (which the base model is supposed to perform). many-shot / few-shot is when you use very little number of samples and expect the model to perform variety of tasks.

    • @abhishekkrthakur
      @abhishekkrthakur  ปีที่แล้ว +7

      The base model is trained on a dataset and task that is entirely different than what we are training it to do. You might say its the same task: text-generation, but since the dataset is different, it is finetuning. Its same as taking a model such as ViT which is trained on images of different categories and training it to perform detection of pneumothorax given chest xray images. Base task remains the same but since dataset is different, its fine-tuning. many-shot/few-shot will involve using the model as it is on a entirely different task by showing it only a few samples: 10-20. This is similar to using a text generation model and showing it only a few samples for example a few pairs of english-german text pairs and then asking it to translate a user-provided english text in to german.

    • @iamfury2k275
      @iamfury2k275 ปีที่แล้ว +2

      ​@@abhishekkrthakur That's correct. I'm working on a project. I was wondering if you could provide insights. I'm working on a blog generation, I've used gpt-3.5-turbo. I prompt engineered it minutely and it provided quite good results. I want to know if I know llama v2 for it as well, if fine tuning it would produce good results as it has 70B parameters compared to 157B parameters for gpt-3.5-turbo. Thank you!

    • @aedesign5499
      @aedesign5499 ปีที่แล้ว

      I think you need knowledge based more than fine tuning because in LLM finetuning is for sounds and images but for content based we need knowledge

  • @EduardoRodriguez-fu4ry
    @EduardoRodriguez-fu4ry ปีที่แล้ว

    Great tutorial! Thank you! Maybe I missed it but, at which point do you enter your HF token?

    • @abhishekkrthakur
      @abhishekkrthakur  ปีที่แล้ว +1

      You dont. You login using "huggingface-cli login" command. There's also a similar command for notebooks and colab. :)

  • @ashishtater3363
    @ashishtater3363 5 หลายเดือนก่อน

    I have llm downloaded can I fine tune it with downloading from huggingface.

  • @manabchetia8382
    @manabchetia8382 ปีที่แล้ว

    Thank you. Can you please also show us how to train on GPU #3 or GPU#1 or both GPU#1&3 but not in GPU #0 in a multi GPU machine?

    • @abhishekkrthakur
      @abhishekkrthakur  ปีที่แล้ว +4

      CUDA_VISIBLE_DEVICES=0 autotrain llm --train ..... will run it on gpu 0
      CUDA_VISIBLE_DEVICES=1,3 autotrain llm --train ..... will run it on gpu 1 and 3

  • @bhaveshbadjatya2914
    @bhaveshbadjatya2914 ปีที่แล้ว

    When tying to use inference API for finetuned model I am getting 'error': "Could not load model XXXX/XXXX with any of the following classes: (,) How to resolve this ?

  • @mohamednajiaboo9817
    @mohamednajiaboo9817 ปีที่แล้ว +2

    Thanks, This really helps. Could you help me clarify my requirement? I am planning to train the LLama v2 over a pdf documents and I want to ask questions about it. I am planning to create CSV text chunks of the pdf documents. So instead of ##instruction ##response, It will be a text context. As a prompt, I am planning to add " You are an agent and carefully understand the context and answer to the questions asked ##context: " then I will follow the auto train to train the model. Do you think this will work ?

    • @rishipatel4652
      @rishipatel4652 ปีที่แล้ว

      Working on a similar use case. Let's connect ?

    • @shameekm2146
      @shameekm2146 ปีที่แล้ว

      Even i am working on this. Have you guys found out any solution?

    • @mohamednajiaboo9817
      @mohamednajiaboo9817 ปีที่แล้ว

      @@shameekm2146 not yet

    • @mohamednajiaboo9817
      @mohamednajiaboo9817 ปีที่แล้ว

      @@rishipatel4652 yes, did yo figure out any solution?

    • @robinpeng9418
      @robinpeng9418 ปีที่แล้ว

      maybe can try vector DB + LLM practice

  • @marioricoibanez144
    @marioricoibanez144 ปีที่แล้ว

    Hey! Fantastic video, but i do not understand at all the division into smaller chunks of the model in order to work in free version of collab, can you explain it? Thank you!

    • @abhishekkrthakur
      @abhishekkrthakur  ปีที่แล้ว

      chunks are loaded into ram first. since larger chunks didnt fit in ram with all the other stuff, i created a version with smaller shards :)

  • @simonv3548
    @simonv3548 ปีที่แล้ว

    Thanks for the nice tutorial. Could you show how to perform inference the finetuned model?

    • @abhishekkrthakur
      @abhishekkrthakur  ปีที่แล้ว +1

      yes. its in one of my previous videos :) thanks!

    • @BrusnickiRoberto
      @BrusnickiRoberto 7 หลายเดือนก่อน

      @@abhishekkrthakur Which one?

  • @kishalmandal5676
    @kishalmandal5676 ปีที่แล้ว

    How can i load the model for inference if i stop training after 1 epoch out of 3 epochs.

  • @mallorywestwood
    @mallorywestwood ปีที่แล้ว

    Can we do this on a CPU? I am using a GGmL model.. please share your thoughts

  • @eltoro2339
    @eltoro2339 ปีที่แล้ว

    I added push_to_hub command but it didnt push.. how do I use it to test the output?

  • @agostonhuszka8237
    @agostonhuszka8237 ปีที่แล้ว

    Thank for the tutorial!
    How can I fine-tune the language model with a domain-specific unlabeled dataset to improve performance on that specific domain? Is it effective to leave the instruction and input empty and only use domain-specific text for the output?

    • @sanjaykotabagi4407
      @sanjaykotabagi4407 ปีที่แล้ว

      Hey, Can we connect. Even I need help on similar topic. We can discuss more ...

  • @susteven4974
    @susteven4974 ปีที่แล้ว

    It's very useful for me , can you share you instruction dataset or just tell me where I can look for some small and good dataset , thank's again !

    • @susteven4974
      @susteven4974 ปีที่แล้ว

      I already found some tiny dataset from huggingface , I will follow your step , that's interesting thing !

  • @ShotterManable
    @ShotterManable ปีที่แล้ว

    Is there a way to run it on CPU? Thanks sir, I love your work

  • @prathampundir5924
    @prathampundir5924 4 หลายเดือนก่อน

    can i train llama3 also with these steps?

  • @protectorate2823
    @protectorate2823 ปีที่แล้ว

    Hello @abishekkrthakur can I train summarization models with autotrain advanced?