Skip to content

Instantly share code, notes, and snippets.

View budgetdevv's full-sized avatar
🤠
Professional Dumbass

TrumpMcDonaldz budgetdevv

🤠
Professional Dumbass
View GitHub Profile
# !pip install --upgrade onnx==1.17.0 onnxruntime==1.20.1 onnxslim==0.1.48 optimum==1.24.0 transformers==4.48.3
import torch
import torch.nn as nn
from transformers import AutoProcessor, AutoModelForCausalLM
import os
import onnxslim
from optimum.onnx.graph_transformations import merge_decoders, check_and_save_model
model = AutoModelForCausalLM.from_pretrained(
[
"928350122843193385",
"1185047194261274665",
"956202276408688650",
"956104664821157918",
"1185047092478095443",
"1185046791826178099",
"1185047045413797898",
"928483283698851901",
"1185047444619284641",
@madaan
madaan / safetensors_to_pytorch_ckpt.py
Last active January 24, 2025 09:42
Safetensors to pytorch checkpoint
from safetensors.torch import load_file
from glob import glob
import torch
from tqdm import tqdm
def main(base_path: str):
"""
Convert safetensors files to pytorch checkpoints files.
@dieseltravis
dieseltravis / emojis-hash.json
Last active April 20, 2025 04:07
get-emoji-kitchen-images.ps1 : download all emoji combination images from the emoji kitchen
{
"u1faa6": "headstone",
"u0038-ufe0f-u20e3": "keycap-8",
"u1f469-u200d-u1f9b1": "woman-curly-hair",
"u1f96b": "canned-food",
"u1f362": "oden",
"u2620-ufe0f": "skull-and-crossbones",
"u1f1ff-u1f1f2": "flag-zambia",
"u1f5e8-ufe0f": "left-speech-bubble",
"u1f3ae": "video-game",
@thesauri
thesauri / change-mac-address-sequoia.md
Last active June 16, 2025 07:12
Change MAC address macOS 12 Monterey

Change MAC address in macOS Sequoia

I was unable to change the MAC address of the Wi-FI device on a MacBook Air (M1 2020) running macOS Sequoia due to the following error: ifconfig: ioctl (SIOCAIFADDR): Can't assign requested addres.

By running the commands in following sequence I was able to change it successfully:

  1. Turn WiFi device off
  2. Turn the WiFi device on again: networksetup -setairportpower en0 on
  3. Change the MAC: ifconfig en0 ether <mac-address-here>
  4. Run: networksetup -detectnewhardware
@imneonizer
imneonizer / how-to-download-from-pan-baidu.md
Last active June 18, 2025 20:44
How to download from pan.baidu without account
@x1unix
x1unix / NET-framework-standalone-exe.md
Last active March 13, 2025 11:10
[C#] Embed DLL assemblies onto executable

Summary

This guide tells how to embed CLR assemblies (.dll) onto a single executable. This works for WPF, WinForms and console .NET applications.

Source - original article

Project settings

First, we need to add special section to .csproj file to make MSBuild embed referenced assemblies

@shadeglare
shadeglare / UnionSerialization.cs
Last active February 28, 2025 11:59
Serialize and deserialize a generic union type with System.Text.Json
using System;
using System.Buffers;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text.Json;
using System.Text.Json.Serialization;
using Hexarc.Annotations;
namespace Hexarc.Union
@guschmue
guschmue / onnx-allnodes-are-outputs.py
Last active March 6, 2024 03:48
diff onnx models node by node
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import logging
import traceback
import numpy as np
import onnx
@bmaupin
bmaupin / free-database-hosting.md
Last active June 18, 2025 17:12
Free database hosting