Skip to content

Instantly share code, notes, and snippets.

AWSTemplateFormatVersion: 2010-09-09
Description: Template which deploys a basic VPC with a single SG, 2 public subnets and an IGW. Optionally can also deploy 2 private subnets and a NAT gateway
Parameters:
Subnet1AzParameter:
Type: AWS::EC2::AvailabilityZone::Name
Description: First subnet avalibility zone
Subnet2AzParameter:
Type: AWS::EC2::AvailabilityZone::Name
Description: Second subnet avalibility zone
# This supports merging as many adapters as you want.
# python merge_adapters.py --base_model_name_or_path <base_model> --peft_model_paths <adapter1> <adapter2> <adapter3> --output_dir <merged_model>
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
@kyo-takano
kyo-takano / making-the-most-of-local-llms.ipynb
Last active May 7, 2024 02:45
ローカルLLMはこーやって使うの💢
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Decencies
Decencies / jnic-3.5.1-evaluator.c
Created February 6, 2023 00:56
JNIC 3.5.1 Sim0n/Evaluator output
This file has been truncated, but you can view the full file.
/*
* Auto-generated JNIC implementation file
*
*
*
*
*
*
*/

Introduction

This small document will explain how I cracked version 3.3.1 of JNIC. (https://jnic.dev)

Motive

The motive of this crack was simply to test the strength of "DRM" applied to JNIC.

Methodology

Discovering the funny :trollface:

Upon opening the JNIC JAR in a decompiler, I quickly discovered a 'JNICLoader' class, which contained methods whos first parameter were MethodHandles (all of these methods were named 'invoke').

@tibordp
tibordp / variant.cc
Last active May 7, 2024 02:40
A simple variant type implementation in C++
#include <iostream>
#include <utility>
#include <typeinfo>
#include <type_traits>
#include <string>
template <size_t arg1, size_t ... others>
struct static_max;
template <size_t arg>
@sebmarkbage
sebmarkbage / The Rules.md
Last active May 7, 2024 02:39
The Rules of React

The Rules of React

All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.

What Functions Are "Pure"?

A number of methods in React are assumed to be "pure".

On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.

@liuran001
liuran001 / config.yaml
Last active May 7, 2024 02:37
mihomo (Clash Meta) 懒人配置
# mihomo (Clash Meta) 懒人配置
# 版本 V1.5-240507
# https://gist.github.com/liuran001/5ca84f7def53c70b554d3f765ff86a33
# https://obdo.cc/meta
# 作者: 笨蛋ovo (bdovo.cc)
# Telegram: https://t.me/baka_not_baka
# 关注我的 Telegram 频道谢谢喵 https://t.me/s/BDovo_Channel
# 修改自官方示例规则 https://wiki.metacubex.one/example/#meta
# 转载请保留此注释
# 尽量添加了较为详尽的注释,不理解的地方建议对照 虚空终端 (Clash Meta) Docs 进行理解
@5ec1cff
5ec1cff / find_zip_entry.cpp
Created April 16, 2024 16:15
Find zip entry by offset
#include <cstdio>
#include <fcntl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <cstring>
#include <cerrno>
#include <string>
#include <utility>