# sequential write
sudo fio --name=write_throughput --directory=. --numjobs=4 \
--size=2G --time_based --runtime=5m --ramp_time=2s --ioengine=libaio \
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
from struct import unpack | |
import numpy as np | |
def read_vec(filepath: str, vec_type: np.dtype = np.float32): | |
"""Read vectors from a file. Support `fvecs`, `ivecs` and `bvecs` format. | |
Args: | |
filepath: The path of the file. | |
vec_type: The type of the vectors, choose from [np.float32, np.int32, np.dtype('u1')] |
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
# 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 && \ |
import json
import base64
import msgpack
import numpy as np
dim = 1536
emb = np.random.rand(dim).astype(np.float32)
emb_list = emb.tolist()
requires:
# terminal 1
python mosec_websocket.py
# terminal 2
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 ( | |
"fmt" | |
"sync" | |
"go.starlark.net/starlark" | |
"go.starlark.net/starlarkstruct" | |
) |
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
from flask import Flask, request | |
app = Flask(__name__) | |
@app.route("/inference", methods=["POST"]) | |
def inference(): | |
return request.get_data() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
local wezterm = require 'wezterm'; | |
function recompute_padding(window) | |
local window_dims = window:get_dimensions(); | |
local overrides = window:get_config_overrides() or {} | |
if not window_dims.is_full_screen then | |
if not overrides.window_padding then | |
-- not changing anything | |
return; |
NewerOlder