Skip to content

Instantly share code, notes, and snippets.

View kemingy's full-sized avatar
🈚
actions

Keming kemingy

🈚
actions
View GitHub Profile
@kemingy
kemingy / pgrx.Dockerfile
Last active December 4, 2024 10:33
pre-build cargo pgrx
# CNPG only support Debian 12 (Bookworm)
FROM ubuntu:22.04
ARG PGRX_VERSION=0.12.8
ARG SCCACHE_VERSION=0.8.2
ENV DEBIAN_FRONTEND=noninteractive \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
RUSTFLAGS="-Dwarnings" \
@kemingy
kemingy / pystone.md
Last active October 17, 2024 03:26
different pyython distribution performance test
@kemingy
kemingy / vecs.md
Last active December 4, 2024 10:37

vecs file format

A binary format to store the vectors.

| dim (4 bytes) | vector (4 * dim bytes) |
| dim (4 bytes) | vector (4 * dim bytes) |
...
| dim (4 bytes) | vector (4 * dim bytes) |
@kemingy
kemingy / Dockerfile
Last active September 21, 2023 06:32
vllm
# use devel since vllm need to compile the paged attention
ARG base=nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04
FROM ${base}
ENV DEBIAN_FRONTEND=noninteractive LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8
ARG commit=main
ARG CONDA_VERSION=py310_23.3.1-0
RUN apt update && \
@kemingy
kemingy / emb_encode.md
Created May 29, 2023 16:22
test OpenAI embedding API encode method
import json
import base64

import msgpack
import numpy as np

dim = 1536
emb = np.random.rand(dim).astype(np.float32)
emb_list = emb.tolist()
package main
import (
"fmt"
"sync"
"go.starlark.net/starlark"
"go.starlark.net/starlarkstruct"
)
from flask import Flask, request
app = Flask(__name__)
@app.route("/inference", methods=["POST"])
def inference():
return request.get_data()
@kemingy
kemingy / logo.svg
Last active September 24, 2021 04:27
MOSEC SVG Logo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.