Skip to content

Instantly share code, notes, and snippets.

View sundy-li's full-sized avatar
🏠
Working from home

sundyli sundy-li

🏠
Working from home
View GitHub Profile
@sundy-li
sundy-li / ollama_fast_speech_text_speech.py
Created February 17, 2024 02:58 — forked from lucataco/ollama_fast_speech_text_speech.py
speech to text to speech using Ollama
""" To use: install Ollama, clone OpenVoice, run this script in the OpenVoice directory
brew install portaudio
brew install git-lfs
git lfs install
git clone https://github.com/myshell-ai/OpenVoice
cd OpenVoice
git clone https://huggingface.co/myshell-ai/OpenVoice
cp -r OpenVoice/* .
## install databend
wget "https://github.com/datafuselabs/databend/releases/download/v1.2.279/databend-v1.2.279-x86_64-unknown-linux-musl.tar.gz"
tar -xzvf databend-v1.2.279-x86_64-unknown-linux-musl.tar.gz
time bin/databend-query local --query """
CREATE FILE FORMAT my_format type = csv field_delimiter = ';' ;
WITH AGG AS(
select city, min(temperature) x , avg(temperature) y, max(temperature) z from(select \$1::String city, \$2::Float64 temperature from 'fs:///home/sundy/work/1brc/measurements.txt'(file_format => 'my_format'))
GROUP BY city
@sundy-li
sundy-li / segment.json
Created February 28, 2023 01:02
fuse meta data
{
"format_version": 1,
"blocks": [
{
"row_count": 1,
"block_size": 76,
"file_size": 360,
"location": [
"53/133/_b/ba4a60013e27479e856f739aefeadfaf_v0.parquet",
0
@sundy-li
sundy-li / clash.yaml
Last active February 6, 2023 01:37
subscribe
This file has been truncated, but you can view the full file.
port: 1090
socks-port: 1080
allow-lan: false
mode: Rule
log-level: info
external-controller: :9090
proxies: ~
proxy-groups:
- name: 🚀 节点选择
type: select
@sundy-li
sundy-li / arrow2_read.rs
Created November 30, 2022 15:42
arrow-arrow2-duckdb
use std::fs;
use std::fs::File;
use std::sync::mpsc::channel;
use std::time::SystemTime;
use arrow2::error::Error;
use arrow2::io::parquet::read::{self, FileReader};
use threadpool::ThreadPool;
// wget https://repo.databend.rs/alapha/input.parquet -O /tmp/input.parquet
@sundy-li
sundy-li / arrow2_read.rs
Last active November 30, 2022 15:30
arrow2-read-write
use std::fs;
use std::fs::File;
use std::sync::mpsc::channel;
use std::time::SystemTime;
use arrow2::error::Error;
use arrow2::io::parquet::read::{self, FileReader};
use threadpool::ThreadPool;
// wget https://repo.databend.rs/alapha/input.parquet -O /tmp/input.parquet
@sundy-li
sundy-li / b.sh
Created February 9, 2022 01:57
databend_bench_sqls
#!/bin/bash
cat << EOF > bench.sql
SELECT avg(number) FROM numbers_mt(100000000000)
SELECT sum(number) FROM numbers_mt(100000000000)
SELECT min(number) FROM numbers_mt(100000000000)
SELECT max(number) FROM numbers_mt(100000000000)
SELECT count(number) FROM numbers_mt(100000000000)
SELECT sum(number+number+number) FROM numbers_mt(100000000000)
SELECT sum(number) / count(number) FROM numbers_mt(100000000000)
@sundy-li
sundy-li / bench_arrow.rs
Created December 27, 2021 03:50
bench_arrow
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
@sundy-li
sundy-li / mod.rs
Created August 9, 2021 07:05
rust-const-generics
// Copyright 2020-2021 The Datafuse Authors.
//
// SPDX-License-Identifier: Apache-2.0.
mod modulo;
use std::marker::PhantomData;
use crate::prelude::*;
use crate::DFNumericType;
@sundy-li
sundy-li / memory_bench.rs
Last active January 16, 2021 03:39
memory_bench.rs
use std::sync::{Mutex, Arc};
use std::env;
use std::time::Instant;
use std::sync::mpsc::channel;
use threadpool::ThreadPool;
// test memory bandwidth
fn main() {