Coder Social home page Coder Social logo

llm_handson's Introduction

Some usecase examples with local LLMs

Open the different notebooks and follow along. The intended order is:

  1. huggingface.ipynb: How to use a LLM from the HuggingFace model hub.
  2. prompt_engineering.ipynb: How to use prompt engineering to improve the quality of the LLM responses.
  3. lora.ipynb: Finetuning a model using QLoRA for a specific task.
  4. rag.ipynb: How to talk with a PDF using Retrieval Augmented Generation (RAG).

The directory llm_server contains a simple API that can be used to serve a LLM in a remote machine.

Usage

  1. Go to a machine with a GPU (at least a 3090) and install the environment:
ssh remote_server
git clone https://github.com/RaulPPelaez/llm_handson
cd llm_handson
mamba create -n llm python==3.11 pip
mamba activate llm
pip install -r requirements.txt
  1. Start a Jupyter Notebook server in a machine where you have a GPU:

Lets give it access to just one GPU.

CUDA_VISIBLE_DEVICES=0 jupyter notebook --no-browser --port 1234
  1. Open the notebook in your laptop using a SSH tunnel:
	ssh -4 -NL 1234:localhost:1234 remote_server &
	firefox http://localhost:1234

llm_handson's People

Contributors

raulppelaez avatar

Stargazers

 avatar  avatar

Watchers

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