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 November 1, 2024 15:30
pre-build cargo pgrx
FROM ubuntu:24.04
ARG PGRX_VERSION=0.12.6
ENV DEBIAN_FRONTEND=noninteractive \
LANG=en_US.UTF-8 \
LC_ALL=en_US.UTF-8
RUN apt update && \
apt install -y --no-install-recommends \
@kemingy
kemingy / pystone.md
Last active October 17, 2024 03:26
different pyython distribution performance test
@kemingy
kemingy / vecs.md
Last active October 10, 2024 15:34

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.