Skip to content

Instantly share code, notes, and snippets.

View lucky-verma's full-sized avatar
💠
FTM

Lucky Verma lucky-verma

💠
FTM
View GitHub Profile
@lucky-verma
lucky-verma / grpo_demo.py
Created January 31, 2025 17: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
@lucky-verma
lucky-verma / row_reduction_techniques.py
Created July 26, 2024 06:07
Comparative Analysis of Row Reduction Techniques for Binary Datasets
"""
Comparative Analysis of Row Reduction Techniques for Binary Datasets
This script demonstrates and compares various methods for reducing
the number of rows in a binary (0/1) dataset, including sampling,
clustering, dimensionality reduction, aggregation, and anomaly detection.
"""
import numpy as np
import pandas as pd
@lucky-verma
lucky-verma / medium.user.js
Created July 11, 2024 23:48 — forked from mathix420/medium.user.js
Bypass Medium Paywall - Working late 2023 - Greasy Fork, Violentmonkey, Tampermonkey - Click the RAW button to install
// ==UserScript==
// @name Medium Paywall Bypass
// @namespace Violentmonkey Scripts
// @run-at document-start
// @match *://*.medium.com/*
// @match *://medium.com/*
// @match *://*/*
// @grant none
// @version 2.4
// @inject-into content
@lucky-verma
lucky-verma / benchmark_pg.py
Created May 16, 2024 23:30 — forked from pwtail/benchmark_pg.py
Benchmark pg
import asyncio
import concurrent
from concurrent.futures import ThreadPoolExecutor
from contextlib import contextmanager
import sys
import random
import time
import uvloop
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
@lucky-verma
lucky-verma / cuda_11.7_installation_on_Ubuntu_22.04
Created May 1, 2023 07:05 — forked from X-TRON404/cuda_11.7_installation_on_Ubuntu_22.04
Instructions for CUDA v11.7 and cuDNN 8.5 installation on Ubuntu 22.04 for PyTorch 1.12.1
#!/bin/bash
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
### to verify your gpu is cuda enable check
@lucky-verma
lucky-verma / templateMatchTrackEVAL.py
Created September 7, 2022 15:09
Template matching for cropped images to get bbox of tracked objects in MOT format.
import cv2
import pathlib
import time
import argparse
import os
import glob
# Construct the argument parser.
parser = argparse.ArgumentParser()
parser.add_argument('-i',
import os
# create a dictionary with file names as keys
# and for each file name the paths where they
# were found
file_paths = {}
for root, dirs, files in os.walk('.'):
for f in files:
if f.endswith('.txt'):
if f not in file_paths:
import shutil
import os
import sys
import json
def changeLineForAllTextfiles(path, old_label, new_label):
for root, dirs, files in os.walk(path):
for file in files:
if file.endswith(".txt"):
file_path = os.path.join(root, file)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.