Coder Social home page Coder Social logo

llama2_local's Introduction

Llama2 on Your Local Computer

Run the new Llama2 and Llama2-Chat models on your local computer.

Getting Started

Installation

  1. Clone the repository:
git clone https://github.com/thisserand/llama2_local.git
cd llama2_local
  1. Install required dependencies:
pip install -r requirements.txt

Prerequisites

To be able to download the model weights and tokenizer from Huggingface, you firtst need to visit the Meta AI website and accept their License (my request got approved within 30 minutes). Make sure that you state the email address that you are also using for your Huggingface account. Once your request got accepted, you need to go to one of the Llama2 Huggingface repositories (e.g., the Llama2-7B model) and request access for there again, as can be seen in the following image (access should be granted right away): Huggingface Llama2 Access

Once you are all set with your access requests the last step is to login to your huggingface account in your current runtime. For this we will use the following command:

huggingface-cli login

You can find your Access Token here (https://huggingface.co/settings/tokens): Huggingface Access Token

Windows

Make sure that you have gcc with version >=11 installed on your computer. Here are steps described by Kevin Anthony Kaw for a successful setup of gcc:

  • CMake version cmake-3.27.0-windows-x86_64.msi installed to root directory ("C:")
  • minGW64 version 11.0.0 extracted to root directory ("C:")
  • set environment path variables for CMake and minGW64
  • install visual studio build tools. It's way at the bottom under "Tools for Visual Studio" drop down list.
  • In visual studio, check the "Desktop development with c++", click install.

Usage

Full Precision (Original)

Llama2-7B:

python llama.py --model_name="meta-llama/Llama-2-7b-hf"

Llama2-7B-Chat:

python llama.py --model_name="meta-llama/Llama-2-7b-chat-hf"

Llama2-13B:

python llama.py --model_name="meta-llama/Llama-2-13b-hf"

Llama2-13B-Chat:

python llama.py --model_name="meta-llama/Llama-2-13b-chat-hf"

Llama2-70B:

python llama.py --model_name="meta-llama/Llama-2-70b-hf"

Llama2-70B-Chat:

python llama.py --model_name="meta-llama/Llama-2-70b-chat-hf"

GPTQ Quantized

Llama2-7B:

python llama.py --model_name="TheBloke/Llama-2-7B-GPTQ"

Llama2-7B-Chat:

python llama.py --model_name="TheBloke/Llama-2-7b-Chat-GPTQ"

Llama2-13B:

python llama.py --model_name="TheBloke/Llama-2-13B-GPTQ"

Llama2-13B-Chat:

python llama.py --model_name="TheBloke/Llama-2-13B-Chat-GPTQ"

Llama2-70B:

python llama.py --model_name="TheBloke/Llama-2-70B-GPTQ"

Llama2-70B-Chat:

python llama.py --model_name="TheBloke/Llama-2-70B-Chat-GPTQ"

GGML Quantized

Llama2-7B:

python llama.py --model_name="TheBloke/Llama-2-7B-GGML" --file_name="llama-2-7b.ggmlv3.q4_K_M.bin"

Llama2-7B-Chat:

python llama.py --model_name="TheBloke/Llama-2-7B-Chat-GGML" --file_name="llama-2-7b-chat.ggmlv3.q4_K_M.bin"

Llama2-13B:

python llama.py --model_name="TheBloke/Llama-2-13B-GGML" --file_name="llama-2-13b.ggmlv3.q4_K_M.bin"

Llama2-13B-Chat:

python llama.py --model_name="TheBloke/Llama-2-13B-Chat-GGML" --file_name="llama-2-13b-chat.ggmlv3.q4_K_M.bin"

llama2_local's People

Contributors

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