Skip to content

Instantly share code, notes, and snippets.

View sugatoray's full-sized avatar
🎯
Focusing

Sugato Ray sugatoray

🎯
Focusing
View GitHub Profile
@sugatoray
sugatoray / scheduler.py
Created August 29, 2025 00:16
Python Scheduler and File Watcher
## install:
## > pip install schedule watchfiles
import os
import time
from datetime import datetime
import schedule
import stat
from watchfiles import watch
@sugatoray
sugatoray / Merge Multiple PPT VBA
Created August 26, 2025 11:50 — forked from bhandarisaurav/Merge Multiple PPT VBA
Simple VBA Script to merge or combine all the powerpoint files in a folder into a new one! Steps: Open a new presentation file and save it to the folder all the files you want to combine are in (you can move it later) Paste the code into the VBA window Run the InsertAllSlides macro and it will combine them.
Sub InsertAllSlides()
' Insert all slides from all presentations in the same folder as this one
' INTO this one; do not attempt to insert THIS file into itself, though.
Dim vArray() As String
Dim x As Long
' Change "*.PPT" to "*.PPTX" or whatever if necessary:
EnumerateFiles ActivePresentation.Path & "\", "*.PPTX", vArray
@sugatoray
sugatoray / custom.css
Created July 23, 2025 21:16 — forked from koaning/custom.css
nintendo.css for marimo
/* Custom CSS for Marimo - Font customization */
/* Import Press Start 2P font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
:root {
--marimo-monospace-font: 'Press Start 2P', 'Courier New', monospace;
--marimo-text-font: 'Press Start 2P', 'Courier New', monospace;
--marimo-heading-font: 'Press Start 2P', 'Courier New', monospace;
}
@sugatoray
sugatoray / pptmerger.ps1
Created July 22, 2025 16:37
pptx-merger
# --- Configuration ---
$sourcePath = "C:\Path\To\Your\SourcePpts" # Folder containing the PPTs to merge
$outputPath = "C:\Path\To\Your\MergedPresentation.pptx" # Full path for the merged output file
# Get a list of PowerPoint files to merge (e.g., all .pptx files)
$pptFiles = Get-ChildItem -Path $sourcePath -Filter "*.pptx" | Sort-Object Name
# --- Check if there are files to merge ---
if ($pptFiles.Count -eq 0) {
Write-Host "No PowerPoint files found in: $sourcePath"
@sugatoray
sugatoray / train.py
Created February 7, 2025 14:01 — forked from ddh0/train.py
Janky pretraining script for small llama models using HF fineweb - modify according to your needs
import os
import torch
import psutil
import datasets
import glob
from transformers import (
AutoTokenizer, LlamaConfig, LlamaForCausalLM, Trainer, TrainingArguments,
DataCollatorForLanguageModeling
)
# /// script
# requires-python = ">=3.11,<3.12"
# dependencies = [
# "distilabel[mlx]",
# ]
# ///
from distilabel.models import MlxLLM
from distilabel.pipeline import InstructionResponsePipeline
llm = MlxLLM(
# /// script
# requires-python = ">=3.11,<3.12"
# dependencies = [
# "distilabel[hf-transformers, hf-inference-endpoints]",
# ]
# ///
from distilabel.models import InferenceEndpointsLLM
from distilabel.pipeline import InstructionResponsePipeline
repo_id = "deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B"
@sugatoray
sugatoray / hf_models_license_top20_dist.md
Created January 3, 2025 11:02
HF Model License Top20 Dist

HF Model License Top20 Dist

image

  • source: HF Model Metadata
  • author: Sugato Ray @sugatoray
@sugatoray
sugatoray / export_locally.py
Created October 15, 2024 14:32 — forked from tomaarsen/export_locally.py
Export Sentence Transformer models to ONNX (+ optimization, quantization) & OpenVINO
# requires sentence_transformers>=3.2.0
from sentence_transformers import SentenceTransformer, export_optimized_onnx_model, export_dynamic_quantized_onnx_model
# The model to export to ONNX (+ optimize, quantize), OpenVINO
model_id = "mixedbread-ai/mxbai-embed-large-v1"
# Where to save the exported models locally
output_dir = model_id.replace("/", "-")
onnx_model = SentenceTransformer(model_id, backend="onnx", model_kwargs={"export": True})
onnx_model.save_pretrained(output_dir)
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