Skip to content

Instantly share code, notes, and snippets.

View mmizutani's full-sized avatar

Minoru Mizutani mmizutani

  • Tokyo
  • 13:21 (UTC +09:00)
View GitHub Profile
export const requireComment = {
meta: {
type: "suggestion",
docs: {
description: "useEffectにはコメントでの説明が必須です。",
},
schema: [],
messages: {
requireCommentOnUseEffect: `useEffectにはコメントでの説明が必須です。
@awni
awni / l3min.py
Last active January 25, 2025 21:30
A minimal, fast implementation of Llama 3.1 in MLX.
"""
A minimal, fast example generating text with Llama 3.1 in MLX.
To run, install the requirements:
pip install -U mlx transformers fire
Then generate text with:
python l3min.py "How tall is K2?"
@veekaybee
veekaybee / normcore-llm.md
Last active April 20, 2025 11:25
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@jvelezmagic
jvelezmagic / main.py
Last active April 15, 2025 14:47
QA Chatbot streaming with source documents example using FastAPI, LangChain Expression Language, OpenAI, and Chroma.
"""QA Chatbot streaming using FastAPI, LangChain Expression Language , OpenAI, and Chroma.
Features
--------
- Persistent Chat Memory:
Stores chat history in a local file.
- Persistent Vector Store:
Stores document embeddings in a local vector store.
- Standalone Question Generation:
Rephrases follow-up questions to standalone questions in their original language.
@doraTeX
doraTeX / ocr.sh
Last active February 20, 2025 14:25
A shell script to perform OCR on images/PDFs using macOS built-in OCR engine -- https://doratex.hatenablog.jp/entry/20230629/1687977178
#!/bin/bash
SCRIPTNAME=$(basename "$0")
function realpath () {
f=$@;
if [ -d "$f" ]; then
base="";
dir="$f";
else
base="/$(basename "$f")";
@rain-1
rain-1 / llama-home.md
Last active January 21, 2025 16:15
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@aspick
aspick / ruby_wasm.md
Last active December 20, 2022 03:27
ruby.wasm を使って Ruby アプリケーションのシングルバイナリを作成する

requirements

steps

# follow `ruby.wasm` tutorial
curl -LO https://github.com/ruby/ruby.wasm/releases/latest/download/ruby-head-wasm32-unknown-wasi-full.tar.gz
@yusukebe
yusukebe / client.ts
Last active December 10, 2022 00:52
import { Client } from '../../../src/middleware/client'
import type { AppType } from './server'
const client = new Client<AppType>('http://127.0.0.1:8787/api')
const res = await client.json('/posts', {
id: 123,
title: 'hello',
})
@dgcoffman
dgcoffman / require-named-effect.js
Created May 23, 2022 16:16
libs/eslint-rules/require-named-effect.js
const isUseEffect = (node) => node.callee.name === 'useEffect';
const argumentIsArrowFunction = (node) => node.arguments[0].type === 'ArrowFunctionExpression';
const effectBodyIsSingleFunction = (node) => {
const { body } = node.arguments[0];
// It's a single unwrapped function call:
// `useEffect(() => theNameOfAFunction(), []);`
if (body.type === 'CallExpression') {
@mislav
mislav / config.json
Last active January 7, 2025 20:51
Experiment in using GitHub CLI to authenticate fetching docker images from GitHub Package Registry
// ~/docker/config.json
{
"credsStore": "desktop",
"credHelpers": {
"docker.pkg.github.com": "gh",
"ghcr.io": "gh"
}
}