Skip to content

Instantly share code, notes, and snippets.

@kohya-ss
kohya-ss / gradio_llm.py
Last active April 25, 2024 05:12
gradioでLLMを利用する簡易クライアント
# Apache License 2.0
# 使用法は gist のコメントを見てください
import argparse
from typing import List, Optional, Union, Iterator
from llama_cpp.llama_chat_format import _convert_completion_to_chat, register_chat_completion_handler
import llama_cpp.llama_types as llama_types
from llama_cpp.llama import LogitsProcessorList, LlamaGrammar
from llama_cpp import Llama, llama_chat_format
import gradio as gr
@juanbrujo
juanbrujo / PlayStationBIOSFilesNAEUJP.md
Last active April 25, 2024 05:07
Files for PlayStation BIOS Files NA-EU-JP
@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active April 25, 2024 05:02
Complete Recent Discord Quest

Complete Recent Discord Quest

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
  2. Join a vc
  3. Stream any window (can be notepad or something)
  4. Press Ctrl+Shift+I to open DevTools
  5. Go to the Console tab
  6. Paste the following code and hit enter:
let wpRequire;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Canvas Game</title>
<style>
canvas {
border: 1px solid black;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Canvas Game</title>
<style>
canvas {
border: 1px solid black;
}
@btahir
btahir / semantic_search.py
Last active April 25, 2024 04:58
MVP For Semantic Search using Sentence Transformers + FAISS
# install packages
# pip install faiss-cpu sentence-transformers
import numpy as np
import torch
import faiss
import time
from sentence_transformers import SentenceTransformer
# https://www.sbert.net/docs/pretrained_models.html#multi-qa-models
@Chaser324
Chaser324 / GitHub-Forking.md
Last active April 25, 2024 04:57
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@juliendkim
juliendkim / Install unbound dns cache on Mac.sh
Last active April 25, 2024 04:56
unbound dns cache server on Mac
$ brew install unbound
$ unbound-anchor -a /usr/local/etc/unbound/root.key
$ unbound-control-setup -d /usr/local/etc/unbound
$ unbound-checkconf /usr/local/etc/unbound/unbound.conf
$ sudo brew services start unbound
@efrecon
efrecon / run.tpl
Last active April 25, 2024 04:55
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name {{printf "%q" .Name}} \
{{- with .HostConfig}}
{{- if .Privileged}}
--privileged \
{{- end}}
{{- if .AutoRemove}}
--rm \
{{- end}}
{{- if .Runtime}}