Skip to content

Instantly share code, notes, and snippets.

@yuce
yuce / get_memory_size.py
Created February 13, 2025 23:46 — forked from philschmid/get_memory_size.py
Get needed GPU per precision for a Hugging Face Model Id
from typing import Dict, Union
from huggingface_hub import get_safetensors_metadata
import argparse
import sys
# Example:
# python get_gpu_memory.py Qwen/Qwen2.5-7B-Instruct
# Dictionary mapping dtype strings to their byte sizes
bytes_per_dtype: Dict[str, float] = {
@yuce
yuce / 0-go-os-arch.md
Created July 15, 2022 03:51 — forked from asukakenji/0-go-os-arch.md
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@yuce
yuce / ParquetToArrow.java
Created June 5, 2020 16:19 — forked from animeshtrivedi/ParquetToArrow.java
Example program to convert Apache Parquet data to Apache Arrow
/* This code snippet is a part of the blog at
https://github.com/animeshtrivedi/blog/blob/master/post/2017-12-26-arrow.md
*/
import com.google.common.collect.ImmutableList;
import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.vector.*;
import org.apache.arrow.vector.dictionary.DictionaryProvider;
import org.apache.arrow.vector.types.FloatingPointPrecision;
import org.apache.arrow.vector.types.pojo.ArrowType;
bindsym $mod+Shift+m move scratchpad
bindsym $mod+Tab scratchpad show
bindsym $mod+m exec i3-input -F 'mark %s' -P 'Mark: '
bindsym $mod+j exec i3-input -F '[con_mark="%s"] focus' -P 'Jump: '
@yuce
yuce / Makefile
Created October 4, 2013 18:11 — forked from ericbmerritt/Makefile
# Copyright 2012 Erlware, LLC. All Rights Reserved.
#
# This file is provided to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,