Code Monkey home page Code Monkey logo

mlops-for-llms-workshop's Introduction

MLOps for LLMs Workshop

This repo builds a Git question-answering chat bot. The goal is both to show how to build such a bot but also how MLOps can help build and iterate on such applications.

This chat bot is built on top of LangChain and uses the Pro Git book as documentation.

This is a chatbot about Git where the training pipeline was built using DVC.

It was initially inspired by https://github.com/hwchase17/notion-qa.

Environment Setup

First you need to do a git pull of the code:

git clone [email protected]:iterative/llm-demo.git
cd llm-demo

You also need Anaconda to install the environment (note: the FAISS dependency will not work without Anaconda).

In order to set your environment up to run the code here, first install all requirements in a conda env:

conda create -n mlops-for-llms-workshop --python=python3.11
conda activate mlops-for-llms-workshop
pip install -r requirements.txt

Then set your Hugging Face API key (if you don't have one, get one here):

  export HUGGINGFACEHUB_API_TOKEN=....

The preceeding spaces prevent the API key from staying in your bash history if that is configured.

Running

Now you should be ready to run any code in the repo.

You can start by exploring the notebooks are in notebooks, or run the whole pipeline in src using DVC:

$ dvc repro

The pipeline is set up to use a simple BM25 retriever, but you can replace it with an embeddings-based retriever by replacing the dvc.yaml file:

$ cp dvc_embeddings.yaml dvc.yaml

There is also a demo web UI you can start using:

$ streamlit run src/main.py

The log of interactions can be found in data/chat.log.

mlops-for-llms-workshop's People

Contributors

dberenbaum 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.