Skip to content

Instantly share code, notes, and snippets.

@msly
msly / main.ts
Created March 22, 2025 11:44 — forked from SoteFun/main.ts
HunyuanInterface
/*
Copyright (c) 2025 Neuroplexus
This software is provided "as is", without warranty of any kind, express or
implied, including but not limited to the warranties of merchantability,
fitness for a particular purpose and noninfringement. In no event shall the
authors or copyright holders be liable for any claim, damages or other
liability, whether in an action of contract, tort or otherwise, arising from,
out of or in connection with the software or the use or other dealings in the
software.
#!/usr/bin/env python3
import gradio as gr
import whisper
from datetime import datetime
last_model_name = "small"
model = whisper.load_model(last_model_name)
@msly
msly / _create_random.cpp
Last active June 20, 2016 03:27
生成类似java的随机数
// 0.8822016520425677
std::string _create_random()
{
static default_random_engine random;
uniform_real_distribution<double> dis(0.0, 1.0);
uniform_int_distribution<int> dis2(100000000, 999999999);
return fmt::format("{}{}", dis(random), dis2(random));
}
@msly
msly / 百度开灯问题.cpp
Last active June 20, 2016 03:27
百度开灯问题
// 百度开灯问题
void light() {
vector<bool> vec(100, true);
for (int i=1; i<101; ++i) {
for (int j=0; j<vec.size(); j=j+i+1) {
vec[j] = !vec[j];
}
}
@msly
msly / phash.cpp
Last active November 14, 2016 08:45
图片相似算法phash
string pHashValue(Mat &src) {
// gray
assert(src.channels() == 1);
string hash(64, '\0');
Mat img, dst;
resize(src, img, Size(32, 32));
img = Mat_<double>(img);