Skip to content

Instantly share code, notes, and snippets.

@VictorTaelin
VictorTaelin / gpt4_abbreviations.md
Last active November 2, 2024 21:46
Notes on the GPT-4 abbreviations tweet

Notes on this tweet.

  • The screenshots were taken on different sessions.

  • The entire sessions are included on the screenshots.

  • I lost the original prompts, so I had to reconstruct them, and still managed to reproduce.

  • The "compressed" version is actually longer! Emojis and abbreviations use more tokens than common words.

@MrSedan
MrSedan / README.md
Last active August 25, 2024 15:36
NAI (NovelAI) prompt to WebUI prompt converter

NAI to WebUI prompt converter

Running

You just need to have python installed on your system and run:

python3 nai_to_webui.py '{{some word}} some prompt...'

Or (not on Windows):

chmod +x nai_to_webui.py
./nai_to_webui.py '{{some word}} some prompt...'
@crosstyan
crosstyan / swap_attn.py
Last active July 29, 2023 19:42
swap attn layer for stable diffusion model
# some code is from https://github.com/CCRcmcpe/scal-sdt
from typing import Any, Literal, Optional
from pathlib import Path
import warnings
import torch
import click
DType = Literal["fp16", "fp32", "bf16"]
LayerName = Literal["attn", "ff"]
StateDict = dict[str, Any]
@Miraculix200
Miraculix200 / gist:e0fc7c02e7911d840f3abe3c7cdae6f9
Created October 31, 2022 18:52
Dreambooth on SageMaker Studio Lab (save as .ipynb notebook)
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"cellView": "form",
"colab": {
"base_uri": "https://localhost:8080/"
},
@woyin
woyin / autosign.php
Created August 10, 2021 03:22
Auto Sign for Discuz DSU
<?php
header("Content-type:text/html;charset=utf-8");
// 设定cookie和网址
// 通过Chrome 或者Edge 找到对应的Cookie值,找到以saltkey和auth 结尾的Cookie 名称和值,填在这里
$cookie = 'xxxxxxx_saltkey=XXXXXXXX;xxxxxxxx_auth=XXXXXX';
// 获取formhash
$URL = "http://bbs.abc.com/forum.php"; //论坛地址
$str = loadcode($cookie,$URL);
@muink
muink / 3.5lo2balance.md
Last active November 7, 2024 03:48
关于3.5单端和2.5 3.5 4.4 平衡间互相转换的几条定理

关于3.5单端和2.5 3.5 4.4 平衡间互相转换的几条定理

3.5立体声与典型平衡口定义

ddt pht

互转定理

  1. 平衡设备之间可以完全地互相转换,只要接口线序一一对应不出错
@fabtho
fabtho / save_screenshot.py
Last active December 12, 2022 08:07
make full screenshot with selenium in python
#!/usr/bin/python
from selenium import webdriver
from PIL import Image
from cStringIO import StringIO
verbose = 1
browser = webdriver.Firefox()
browser.get('http://stackoverflow.com/questions/37906704/taking-a-whole-page-screenshot-with-selenium-marionette-in-python')
{
"presets": [
{
"Name": "Major",
"Value": "1;3;5;6;8;10;12",
"Group": "Common"
},
{
"Name": "Minor",
"Value": "1;3;4;6;8;9;11",
@samidhtalsania
samidhtalsania / bintree.py
Last active October 28, 2022 14:28
Binary tree in Python
class Node():
def __init__(self,key):
self.key = key
self.left = None
self.right = None
self.parent = None
class Tree():