Skip to content

Instantly share code, notes, and snippets.

View laksh9950's full-sized avatar

Laxya Agarwal laksh9950

View GitHub Profile
@nateraw
nateraw / Code.gs
Created July 20, 2021 18:42
Add Translation to Google Sheets using HuggingFace's API
function TRANSLATE(text, repo_id="Helsinki-NLP/opus-mt-en-es") {
endpoint = "https://api-inference.huggingface.co/pipeline/translation/" + repo_id;
const payload = JSON.stringify({
"inputs": text
});
// Add your token from https://huggingface.co/settings/token
const options = {
"headers": {"Authorization": "Bearer <YOUR HUGGINGFACE API KEY>"},
"wait_for_model": true,
@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active July 1, 2024 05:32
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin