Skip to content

Instantly share code, notes, and snippets.

View ziozzang's full-sized avatar

Jioh L. Jung ziozzang

View GitHub Profile
@silphendio
silphendio / frankenmerge-test.py
Last active October 14, 2024 18:07
Cutting up a llama and putting it back together
# A simple script to demonstrate the sclicing and recombination of models at runtime
# inspired by mergekit
# Sadly, it doesn't work with quantisized models.
#
# public domain - silphendio
from transformers import AutoTokenizer, AutoModelForCausalLM, TextStreamer
import torch
model_path = 'gpt2' # huggingface name or local folder
@Birch-san
Birch-san / local-copilot.md
Last active June 26, 2024 06:58
Running GitHub Copilot against local Code Llama model

Running GitHub Copilot VSCode extension against local Code Llama model

image

image

Tested on NVIDIA RTX 4090, but these instructions also cover AMD and Mac in case you wanna try those.
This guide assumes you are running Linux (I ran this on Ubuntu).

Before you get excited:

@epicfilemcnulty
epicfilemcnulty / 2safetensors.py
Created September 13, 2023 20:21
convert pytorch weights to safetensors
import json
import os
import sys
from collections import defaultdict
from tqdm import tqdm
import argparse
import torch
from safetensors.torch import load_file, save_file

The following installation methods were tried out.

Working instances of Ceph OSD service

Container-based solution (partially working)

With some trial and error, I managed to get a stand alone Ceph Object Storage Device (OSD) service working. The instructions to replicate the installation are as follows.

version: '3'
volumes:
postgres_data:
driver: local
services:
postgres:
image: postgres
volumes:
@yougg
yougg / proxy.md
Last active November 17, 2024 03:28
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)

Setup Consul with ACL

This will setup a single node Consul cluster. Development mode is not used in order to allow data persistence. We'll be interacting with the Consul server from within the container for simplicity.

Create Consul configuration and persistent data directories

$ mkdir p consul/config consul/data
@detiber
detiber / README.md
Last active October 24, 2024 05:56
Using CFSSL as an external CA for kubeadm

CFSSL as an external CA for non-ha kubeadm intialized clusters

Using cfssl to Create an External CA Infrastructure

Install cfssl

# This requires an existing Go environment with GOPATH set
go get -u github.com/cloudflare/cfssl/cmd/...
@ValdikSS
ValdikSS / huawei-e5885-backup.md
Last active August 4, 2024 13:35
How to backup current firmware on Huawei E5885

Huawei E5885 current firmware backup manual.

  1. Download modified usbloader, which will copy proper busybox into /system/busybox and enable telnetd on your device (will add additional line into /system/autorun.sh). Use it only on E5885, not on other device!
  2. Load it using balong-usbdload. Refer to this disassembling manual.
  3. After loading, wait about one minute, disconnect device from the computer and power off the device holding power button for ~15 seconds.
  4. Insert MicroSD card to the device and power it on.
  5. telnet 192.168.8.1 2323
/system/busybox sh
@foriequal0
foriequal0 / yaminjeongeum.user.js
Last active May 20, 2024 05:26
브라우저의 모든 텍스트를 야민정음으로 바꿔줍니다
// 브라우저에 GreaseMonkey(Firefox) TamperMonkey(Chrome) 을 설치하고,
// https://gist.github.com/foriequal0/154e73d3289d808e8ce94603f5eff6a4/raw/yaminjeongeum.user.js
// 위 링크를 브라우저에 입력하면 자동으로 스크립트를 설치하겠느냐는 창이 뜹니다.
// ==UserScript==
// @name yaminjeongeum
// @namespace yaminjeongeum.kr
// @description 야민정음
// @include *
// @exclude file://*