This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
) | |
func main() { | |
mux := http.NewServeMux() | |
mux.HandleFunc("/", func(writer http.ResponseWriter, request *http.Request) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package otp | |
import ( | |
"bytes" | |
"crypto/hmac" | |
"crypto/sha1" | |
"encoding/binary" | |
"strconv" | |
"strings" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This script is meant for quick & easy install via: | |
# $ curl -fsSL https://gist.github.com/Mikubill/e6bf3877a967e4689066a8fd03c62818/raw/init.sh | bash | |
# | |
# For docker support: | |
# $ curl -fsSL https://gist.github.com/Mikubill/e6bf3877a967e4689066a8fd03c62818/raw/init.sh | bash -s docker | |
# | |
# For wireguard support: | |
# $ curl -fsSL https://gist.github.com/Mikubill/e6bf3877a967e4689066a8fd03c62818/raw/init.sh | bash -s wg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
command_exists() { | |
command -v "$@" > /dev/null 2>&1 | |
} | |
user="$(id -un 2>/dev/null || true)" | |
# username="neko-$(tr -dc 0-9a-f </dev/urandom | head -c 2)" | |
# original="$(hostname)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Simple script to finetune a stable-diffusion model''' | |
import argparse | |
import contextlib | |
import copy | |
import gc | |
import hashlib | |
import itertools | |
import json | |
import math |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os.path | |
import re | |
import tempfile | |
import argparse | |
import glob | |
import zipfile | |
import deepdanbooru as dd | |
import tensorflow as tf | |
import numpy as np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import openai | |
import requests | |
from copy import deepcopy | |
from datetime import date | |
today = date.today() | |
openai.api_key = "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import openai | |
import gradio as gr | |
openai.api_key = os.environ['OPENAI_KEY'] | |
supportLanguages = [ | |
["auto", "auto"], | |
["粤语", "yue"], | |
["古文", "wyw"], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# NAFNet Image Upscaler | |
# Mikubill, MIT License | |
# | |
# Usage: | |
# python nafnet.py -i [path_to_images] | |
# | |
# Parameters: | |
# -m, --model: Specifies the model to use. The default is NAFNet-REDS-width64. | |
# -i, --input: Path to the directory containing images to upscale. This parameter is required. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import clip | |
import pandas as pd | |
import hashlib | |
import numpy | |
import cv2 | |
from tqdm.auto import tqdm |
OlderNewer