Giter VIP home page Giter VIP logo

fine-tuning-demo's Introduction

Customize LLMs Through Fine-Tuning demo

This code is only for educational purposes on fine tuning LLMs and has been explained on the Deep Dive into LLMs S1E3 episode. As we saw in the episode, fine-tuning allows to customize your LLM. There are different way you can customize an LLM. Here we showcase Fine-tuning and Continued pre-training.

Fine-tuning Continued pre-training
Purpose Adapt the pre-trained model to perform well on specific downstream tasks. Specialize the model for tasks such as sentiment analysis, question answering, text classification, etc. Enhance the model's general language understanding and capabilities. Improve the model by exposing it to more data, which may include more diverse, updated, or domain-specific texts.
Data Involves smaller, labeled datasets that are specific to the task at hand. Typically involves large, diverse, and possibly unsupervised datasets similar to the original pre-training data.
Parameters Typically involves updating all the model's parameters, but can also use techniques that modify a subset of parameters (e.g., parameter-efficient fine-tuning). All the model's parameters (weights) are usually updated.
Outcome A specialized model that performs well on specific tasks but may not retain the same level of general language understanding as before. A more generally knowledgeable and capable model that can better understand and generate language across a wide range of contexts.

Quickstart

  1. In your terminal :
pip install requirements.txt
  1. Go to your AWS account
  2. Upload the datasets from the data folder in a S3 bucket
  3. Search Bedrock and click on get started
  4. Click on Custom models
  5. Click on Customize model
  6. Create a Fine-tuning job
  7. Select the model you want to fine-tune, set a name, a job name, the location of your S3 bucket, the output location (can be the same S3 bucket)
  8. Choose a role or create a new one.
  9. Click on create Fine-tuning job
  10. Once it's created and deployed you can replace the modelId in the main.py file with the arn of your custom model.
  11. To send a query change the prompt in the main.py file and run the file
python path/to/main.py

fine-tuning-demo's People

Contributors

amagash avatar

Stargazers

Alonso GIRALDO avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.