Skip to content

Instantly share code, notes, and snippets.

View rahul1906's full-sized avatar

Rahul Ravishankar rahul1906

View GitHub Profile
@willccbb
willccbb / grpo_demo.py
Last active March 16, 2026 11:22
GRPO Llama-1B
# train_grpo.py
#
# See https://github.com/willccbb/verifiers for ongoing developments
#
"""
citation:
@misc{brown2025grpodemo,
title={Granular Format Rewards for Eliciting Mathematical Reasoning Capabilities in Small Language Models},
author={Brown, William},
import asyncio
import base64
import json
import os
import pyaudio
from websockets.asyncio.client import connect
class SimpleGeminiVoice:
def __init__(self):
@karpathy
karpathy / add_to_zshrc.sh
Created August 25, 2024 20:43
Git Commit Message AI
# -----------------------------------------------------------------------------
# AI-powered Git Commit Function
# Copy paste this gist into your ~/.bashrc or ~/.zshrc to gain the `gcm` command. It:
# 1) gets the current staged changed diff
# 2) sends them to an LLM to write the git commit message
# 3) allows you to easily accept, edit, regenerate, cancel
# But - just read and edit the code however you like
# the `llm` CLI util is awesome, can get it here: https://llm.datasette.io/en/stable/
gcm() {
@bmaupin
bmaupin / tiling-extensions-for-gnome.md
Last active March 4, 2026 10:14
Tiling extensions for Gnome

Goal: find a Linux alternative to FancyZones for Windows

Name Recommended Type Supports main colum Supports layouts Multiple windows in same tile Windows can span multiple zones Notes
Tiling Shell πŸ‘πŸ‘πŸ‘ Gnome extension yes yes yes yes Explicitly inspired by Windows tiling, works great out of the box
gSnap πŸ‘πŸ‘ Gnome extension yes yes yes yes Can be configured almost just like FancyZones; in the settings:
  • disable Show tabs
  • enable Hold CTRL to snap windows
gTile Gnome extension no?
Tiling Assistant ([Now bundled with Ubuntu](https://www.omgubuntu.co.uk/2023/06/
@rasbt
rasbt / whisper-audio-to-text.py
Created January 26, 2023 17:46
Transcribes audio files using OpenAI Whisper
# Setup:
# conda create -n whisper python=3.9
# conda activate whisper
# https://github.com/openai/whisper
# pip install git+https://github.com/openai/whisper.git
# Usage:
# python whisper-audio-to-text.py --audio_dir my_files --out_dir texts
import argparse
@rasbt
rasbt / video-subtitles-via-whisper.py
Last active March 20, 2025 13:55
Script that creates subtitles (closed captions) for all MP4 video files in your current directory
# Sebastian Raschka 09/24/2022
# Create a new conda environment and packages
# conda create -n whisper python=3.9
# conda activate whisper
# conda install mlxtend -c conda-forge
# Install ffmpeg
# macOS & homebrew
# brew install ffmpeg
# Ubuntu
@ejmejm
ejmejm / pytorch_tips_yt_follow.ipynb
Created May 9, 2021 09:14
pytorch_tips_yt_follow.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@fclesio
fclesio / get_classification_report.py
Created March 4, 2020 12:21
Scikit Learn Classification Report in Dataframe
def get_classification_report(y_test, y_pred):
'''Source: https://stackoverflow.com/questions/39662398/scikit-learn-output-metrics-classification-report-into-csv-tab-delimited-format'''
from sklearn import metrics
report = metrics.classification_report(y_test, y_pred, output_dict=True)
df_classification_report = pd.DataFrame(report).transpose()
df_classification_report = df_classification_report.sort_values(by=['f1-score'], ascending=False)
return df_classification_report