Skip to content

Latest commit

 

History

History
103 lines (87 loc) · 5.13 KB

README.md

File metadata and controls

103 lines (87 loc) · 5.13 KB

Demystifying Generative AI And Machine Learning Models

Women In Tech Boston; Oct 2-3, 2023

Alt text Alt text

Hands-On workshop to build custom application using Large Language Models (Llama2)

This repository contains instructions and code for building custom applications using LLM, and Dataset Builder Utility code for generating a custom mini training dataset for cost effective model tuning.

Goals

  • Get familiarized with Generative AI models ecosystem
  • Review core LLM concepts
  • Overview of Prompt Engineering
  • Learn how to fine tune a custom model for a domain specific use case
  • Build an app using a pre-trained base LLM and domain specific fine-tuned LLM Alt text

Repository contains

  • Installation instructions for the Open Source technologies this workshop uses
  • Account setup instructions to use Open Sourced Meta Llama2 models
  • Code to build simple chatbot application using Llama2 and Streamlit
  • Custom mini dataset creator for fine tuning Llama2
  • Sample datasets
  • Replicate model training scripts
  • Dataset builder utility code

Pre-workshop setup steps

We will be using following tools and resources

Setup instructions

  • If you are using Windows, I recommend using Anaconda for the ease of installation. Create environment in Anaconda, launch a command propmpt and run pip3 install -r ./requirements.txt

  • For Mac, Install Homebrew if you don't have it.
    Go to a terminal and run $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

  • Install python 3.8 using homebrew
    brew install python@3.8

  • Checkout this repository
    git clone git@github.com:coder-lgtm/llm-demo.git
    (You will need to have SSH key setup for this)

    OR
    git clone https://github.com/coder-lgtm/llm-demo.git
    (You do not need SSH key for setup for this)

    OR
    Just download the repository from https://github.com/coder-lgtm/llm-demo/archive/refs/heads/main.zip and unzip

  • Navigate to llm-demo/app directory and run the following to install dependencies using the requirements.txt
    If you want to run this app locally, you will need to install streamlit and replicate packages. Following command will do just that.
    pip3 install -r ./requirements.txt

  • Create an account on Replicate. You should receive an API key that starts with r8_<>. You will need this for this workshop. I used my github account to login, this helps with the integration greatly.

Workshop Agenda

  • Familiarize yourself with Replicate interface Alt text

  • Overview of Streamlit

  • Go over the Demo Chat App code

  • Execute the code and launch the Streamlit app - tweak the different controls to see the variations in the app behavior

  • Discuss the process of Fine Tuning LLM base model

    Alt text

    Alt text

  • Build a new app with the domain-specitic fine tuned model

  • Compare the performance of the custom model against the base Llama2 model

References and useful links