Skip to content

Instantly share code, notes, and snippets.

View Shivjiagnihotri's full-sized avatar
🎯
Focusing

Shivji Agnihotri Shivjiagnihotri

🎯
Focusing
View GitHub Profile
@lewtun
lewtun / sft_trainer.py
Last active June 19, 2024 13:48
Fine-tuning Mistral 7B with TRL & DeepSpeed ZeRO-3
# This is a modified version of TRL's `SFTTrainer` example (https://github.com/huggingface/trl/blob/main/examples/scripts/sft_trainer.py),
# adapted to run with DeepSpeed ZeRO-3 and Mistral-7B-V1.0. The settings below were run on 1 node of 8 x A100 (80GB) GPUs.
#
# Usage:
# - Install the latest transformers & accelerate versions: `pip install -U transformers accelerate`
# - Install deepspeed: `pip install deepspeed==0.9.5`
# - Install TRL from main: pip install git+https://github.com/huggingface/trl.git
# - Clone the repo: git clone github.com/huggingface/trl.git
# - Copy this Gist into trl/examples/scripts
# - Run from root of trl repo with: accelerate launch --config_file=examples/accelerate_configs/deepspeed_zero3.yaml --gradient_accumulation_steps 8 examples/scripts/sft_trainer.py
@asehmi
asehmi / stqdm-demo.py
Last active March 25, 2024 18:44
STqdm: A tqdm-like progress bar for Streamlit
# UPDATED: 5-MAY-2023
from multiprocessing import Pool, freeze_support
from time import sleep
import streamlit as st
# https://discuss.streamlit.io/t/stqdm-a-tqdm-like-progress-bar-for-streamlit/10097
# pip install stqdm
from stqdm import stqdm
@mbostock
mbostock / .block
Last active April 19, 2024 09:41 — forked from mbostock/.block
Radial Cluster Dendrogram
license: gpl-3.0
height: 950
border: no