Skip to content

Instantly share code, notes, and snippets.

View Neilblaze's full-sized avatar
╰( ▀ ͜͞ʖ▀)つ──☆*:・゚ Hacking 👨‍💻

Pratyay Banerjee Neilblaze

╰( ▀ ͜͞ʖ▀)つ──☆*:・゚ Hacking 👨‍💻
View GitHub Profile
@Neilblaze
Neilblaze / Instructions.md
Last active February 8, 2025 22:16 — forked from awni/README.md
Test Time Scaling with R1-based Models and MLX LM

Test Time Scaling with MLX LM and R1-based LLMs

Install MLX LM:

pip install mlx-lm

And run:

@Neilblaze
Neilblaze / grpo_demo.py
Created February 1, 2025 23:23 — 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
Classify user search queries as either "Good Google Search Query" or "Bad Google Search Query" based on their likelihood of yielding relevant and helpful results from Google Search.
Input: User search query (text string).
Output: Classification label:
* Good Google Search Query: The query is likely to be effectively answered by Google Search.
* Bad Google Search Query: The query is unlikely to be effectively answered by Google Search. Further categorize "Bad" queries into subtypes for better understanding and classifier training (optional but highly recommended):
* Chit-Chat/Conversational/Social
* Personal/Subjective/Opinion-Based (Un-searchable)
* Vague/Ambiguous/Lacking Specificity
Begin by enclosing all thoughts within <thinking> tags, exploring multiple angles and approaches.
Break down the solution into clear steps within <step> tags. Start with a 20-step budget, requesting more for complex problems if needed.
Use <count> tags after each step to show the remaining budget. Stop when reaching 0.
Continuously adjust your reasoning based on intermediate results and reflections, adapting your strategy as you progress.
Regularly evaluate progress using <reflection> tags. Be critical and honest about your reasoning process.
Assign a quality score between 0.0 and 1.0 using <reward> tags after each reflection. Use this to guide your approach:
0.8+: Continue current approach
0.5-0.7: Consider minor adjustments
Below 0.5: Seriously consider backtracking and trying a different approach
@Neilblaze
Neilblaze / upgrade.md
Created August 28, 2024 14:36
Ubuntu 20.04 LTS to 22.04 LTS (for R-Pi 4B)

Here's a step-by-step procedure to upgrade your Raspberry Pi 4B from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS:

  1. Update your current system:
    sudo apt update
    sudo apt upgrade -y
    sudo apt dist-upgrade -y
    sudo apt autoremove -y
    
@Neilblaze
Neilblaze / add_to_zshrc.sh
Created August 26, 2024 18:36 — forked from karpathy/add_to_zshrc.sh
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() {
@Neilblaze
Neilblaze / work-with-multiple-github-accounts.md
Created June 12, 2024 19:16 — forked from rahularity/work-with-multiple-github-accounts.md
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@Neilblaze
Neilblaze / vesper-dark.json
Created May 12, 2024 16:10 — forked from bdsqqq/vesper-dark.json
Vesper theme for zed.dev
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"name": "Vesper",
"author": "Rauno Freiberg",
"themes": [
{
"name": "Vesper",
"appearance": "dark",
"style": {
"border": "#101010",
@Neilblaze
Neilblaze / normcore-llm.md
Created September 7, 2023 14:58 — forked from veekaybee/normcore-llm.md
Normcore LLM Reads