Skip to content

Instantly share code, notes, and snippets.

View bijoyboban7's full-sized avatar
💭
Building...

Bijoy Boban bijoyboban7

💭
Building...
  • Denver
  • 10:27 (UTC -06:00)
View GitHub Profile
@bijoyboban7
bijoyboban7 / grpo_demo.py
Created February 8, 2025 20:27 — forked from willccbb/grpo_demo.py
GRPO Llama-1B
# train_grpo.py
import re
import torch
from datasets import load_dataset, Dataset
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import LoraConfig
from trl import GRPOConfig, GRPOTrainer
# Load and prep dataset
@bijoyboban7
bijoyboban7 / get_memory_size.py
Created January 16, 2025 14:29 — forked from philschmid/get_memory_size.py
Get needed GPU per precision for a Hugging Face Model Id
from typing import Dict, Union
from huggingface_hub import get_safetensors_metadata
import argparse
import sys
# Example:
# python get_gpu_memory.py Qwen/Qwen2.5-7B-Instruct
# Dictionary mapping dtype strings to their byte sizes
bytes_per_dtype: Dict[str, float] = {
@bijoyboban7
bijoyboban7 / MNISTwithKeras.py
Created June 17, 2021 07:10 — forked from prateekchandrayan/MNISTwithKeras.py
MNIST prediction using Keras and building CNN from scratch in Keras
#Step 1
import cv2 # working with, mainly resizing, images
import numpy as np # dealing with arrays
import os # dealing with directories
from random import shuffle # mixing up or currently ordered data that might lead our network astray in training.
from tqdm import tqdm # a nice pretty percentage bar for tasks. Thanks to viewer Daniel BA1/4hler for this suggestion
import tensorflow as tf #Import Tensorflow
import glob #This will extract all files from the folder
import keras
from keras.preprocessing.image import ImageDataGenerator