Skip to content

Commit 768506e

Browse files
author
admin
committed
upl codes
1 parent c8619aa commit 768506e

11 files changed

Lines changed: 590 additions & 213 deletions

File tree

.gitattributes

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
*.7z filter=lfs diff=lfs merge=lfs -text
2+
*.arrow filter=lfs diff=lfs merge=lfs -text
3+
*.bin filter=lfs diff=lfs merge=lfs -text
4+
*.bin.* filter=lfs diff=lfs merge=lfs -text
5+
*.bz2 filter=lfs diff=lfs merge=lfs -text
6+
*.ftz filter=lfs diff=lfs merge=lfs -text
7+
*.gz filter=lfs diff=lfs merge=lfs -text
8+
*.h5 filter=lfs diff=lfs merge=lfs -text
9+
*.joblib filter=lfs diff=lfs merge=lfs -text
10+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
11+
*.model filter=lfs diff=lfs merge=lfs -text
12+
*.msgpack filter=lfs diff=lfs merge=lfs -text
13+
*.onnx filter=lfs diff=lfs merge=lfs -text
14+
*.ot filter=lfs diff=lfs merge=lfs -text
15+
*.parquet filter=lfs diff=lfs merge=lfs -text
16+
*.pb filter=lfs diff=lfs merge=lfs -text
17+
*.pt filter=lfs diff=lfs merge=lfs -text
18+
*.pth filter=lfs diff=lfs merge=lfs -text
19+
*.rar filter=lfs diff=lfs merge=lfs -text
20+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
21+
*.tar.* filter=lfs diff=lfs merge=lfs -text
22+
*.tflite filter=lfs diff=lfs merge=lfs -text
23+
*.tgz filter=lfs diff=lfs merge=lfs -text
24+
*.xz filter=lfs diff=lfs merge=lfs -text
25+
*.zip filter=lfs diff=lfs merge=lfs -text
26+
*.zstandard filter=lfs diff=lfs merge=lfs -text
27+
*.tfevents* filter=lfs diff=lfs merge=lfs -text
28+
*.db* filter=lfs diff=lfs merge=lfs -text
29+
*.ark* filter=lfs diff=lfs merge=lfs -text
30+
**/*ckpt*data* filter=lfs diff=lfs merge=lfs -text
31+
**/*ckpt*.meta filter=lfs diff=lfs merge=lfs -text
32+
**/*ckpt*.index filter=lfs diff=lfs merge=lfs -text
33+
*.safetensors filter=lfs diff=lfs merge=lfs -text
34+
*.ckpt filter=lfs diff=lfs merge=lfs -text
35+
*.wav filter=lfs diff=lfs merge=lfs -text

.github/restart.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
import time
2+
import argparse
3+
import requests
4+
from modelscope import HubApi
5+
6+
7+
def restart_studio(
8+
token: str,
9+
repo="ccmusic-database/erhu_playing_tech",
10+
endpoint="https://www.modelscope.cn",
11+
hold=5,
12+
):
13+
repo_page = f"{endpoint}/studios/{repo}"
14+
status_api = f"{endpoint}/api/v1/studio/{repo}/status"
15+
reboot_api = f"{endpoint}/api/v1/studio/{repo}/reset_restart"
16+
try:
17+
header = {
18+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537",
19+
"Cookie": token2ck(token),
20+
}
21+
response = requests.put(reboot_api, headers=header)
22+
response.raise_for_status()
23+
time.sleep(hold)
24+
while (
25+
requests.get(status_api, headers=header).json()["Data"]["Status"]
26+
!= "Running"
27+
):
28+
requests.get(repo_page, headers=header)
29+
time.sleep(hold)
30+
31+
except requests.exceptions.Timeout as e:
32+
print(f"激活创空间 {repo} 失败: {e}, 重试中...")
33+
restart_studio(repo)
34+
35+
except Exception as e:
36+
print(f"激活创空间 {repo} 失败: {e}")
37+
38+
39+
def token2ck(token: str) -> str:
40+
api = HubApi()
41+
api.login(token)
42+
ck_dict = api.session.cookies.get_dict()
43+
cookies = [f"{k}={v}" for k, v in ck_dict.items()]
44+
return "; ".join(cookies)
45+
46+
47+
if __name__ == "__main__":
48+
parser = argparse.ArgumentParser(description="Reset restart ModelScope studio")
49+
parser.add_argument("--token", required=True, help="Your ModelScope Access Token")
50+
args = parser.parse_args()
51+
restart_studio(args.token)

.github/workflows/auto-sync.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: auto-sync
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
# 允许手动触发
9+
10+
permissions:
11+
contents: write
12+
13+
jobs:
14+
sync-file:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
# Step 1: 检出当前仓库代码
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
# Step 2: 同步至 ModelScope
23+
- name: Sync Files to ModelScope
24+
env:
25+
MS_TOKEN: ${{ secrets.MS_TOKEN }}
26+
GIT_NAME: ${{ secrets.GIT_NAME }}
27+
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
28+
run: |
29+
git clone https://oauth2:$MS_TOKEN@www.modelscope.cn/studios/ccmusic-database/erhu_playing_tech.git ../ms_repo
30+
mv -f ./.github/restart.py ../
31+
rm -rf ./LICENSE ./README.md ./.github ./.git ./.gitattributes ./.gitignore
32+
cp -rf ../ms_repo/.git ../ms_repo/requirements.txt ./
33+
if [ -n "$(git status --porcelain)" ]; then
34+
echo "Files are different, committing changes..."
35+
git config --global user.name "$GIT_NAME"
36+
git config --global user.email "$GIT_EMAIL"
37+
git add .
38+
git commit -m "Auto sync at $(date +%Y-%m-%d)"
39+
git push
40+
pip install modelscope
41+
python ../restart.py --token $MS_TOKEN
42+
else
43+
echo "Files are the same, no changes."
44+
fi
45+
46+
# Step 3: 同步至 HuggingFace
47+
- name: Sync Files to HuggingFace
48+
env:
49+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
50+
GIT_NAME: ${{ secrets.GIT_NAME }}
51+
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
52+
run: |
53+
git clone https://oauth2:$HF_TOKEN@huggingface.co/spaces/ccmusic-database/erhu_playing_tech ../hf_repo
54+
rm -rf ./.git
55+
cp -rf ../hf_repo/.git ../hf_repo/README.md ../hf_repo/requirements.txt ./
56+
if [ -n "$(git status --porcelain)" ]; then
57+
echo "Files are different, committing changes..."
58+
git config --global user.name "$GIT_NAME"
59+
git config --global user.email "$GIT_EMAIL"
60+
git add .
61+
git commit -m "Auto sync at $(date +%Y-%m-%d)"
62+
git push
63+
else
64+
echo "Files are the same, no changes."
65+
fi

.gitignore

Lines changed: 5 additions & 138 deletions
Original file line numberDiff line numberDiff line change
@@ -1,138 +1,5 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
3-
*.py[cod]
4-
*$py.class
5-
6-
# C extensions
7-
*.so
8-
9-
# Distribution / packaging
10-
.Python
11-
build/
12-
develop-eggs/
13-
dist/
14-
downloads/
15-
eggs/
16-
.eggs/
17-
lib/
18-
lib64/
19-
parts/
20-
sdist/
21-
var/
22-
wheels/
23-
share/python-wheels/
24-
*.egg-info/
25-
.installed.cfg
26-
*.egg
27-
MANIFEST
28-
29-
# PyInstaller
30-
# Usually these files are written by a python script from a template
31-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32-
*.manifest
33-
*.spec
34-
35-
# Installer logs
36-
pip-log.txt
37-
pip-delete-this-directory.txt
38-
39-
# Unit test / coverage reports
40-
htmlcov/
41-
.tox/
42-
.nox/
43-
.coverage
44-
.coverage.*
45-
.cache
46-
nosetests.xml
47-
coverage.xml
48-
*.cover
49-
*.py,cover
50-
.hypothesis/
51-
.pytest_cache/
52-
cover/
53-
54-
# Translations
55-
*.mo
56-
*.pot
57-
58-
# Django stuff:
59-
*.log
60-
local_settings.py
61-
db.sqlite3
62-
db.sqlite3-journal
63-
64-
# Flask stuff:
65-
instance/
66-
.webassets-cache
67-
68-
# Scrapy stuff:
69-
.scrapy
70-
71-
# Sphinx documentation
72-
docs/_build/
73-
74-
# PyBuilder
75-
.pybuilder/
76-
target/
77-
78-
# Jupyter Notebook
79-
.ipynb_checkpoints
80-
81-
# IPython
82-
profile_default/
83-
ipython_config.py
84-
85-
# pyenv
86-
# For a library or package, you might want to ignore these files since the code is
87-
# intended to run in multiple environments; otherwise, check them in:
88-
# .python-version
89-
90-
# pipenv
91-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94-
# install all needed dependencies.
95-
#Pipfile.lock
96-
97-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
98-
__pypackages__/
99-
100-
# Celery stuff
101-
celerybeat-schedule
102-
celerybeat.pid
103-
104-
# SageMath parsed files
105-
*.sage.py
106-
107-
# Environments
108-
.env
109-
.venv
110-
env/
111-
venv/
112-
ENV/
113-
env.bak/
114-
venv.bak/
115-
116-
# Spyder project settings
117-
.spyderproject
118-
.spyproject
119-
120-
# Rope project settings
121-
.ropeproject
122-
123-
# mkdocs documentation
124-
/site
125-
126-
# mypy
127-
.mypy_cache/
128-
.dmypy.json
129-
dmypy.json
130-
131-
# Pyre type checker
132-
.pyre/
133-
134-
# pytype static type analyzer
135-
.pytype/
136-
137-
# Cython debug symbols
138-
cython_debug/
1+
*.pt
2+
__pycache__/*
3+
tmp/*
4+
flagged/*
5+
test.*

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2026 Monet
3+
Copyright (c)
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.en.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

README.md

Lines changed: 6 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,7 @@
1-
# erhu_playing_tech
1+
# 二胡演奏技法识别器 WebUI
2+
[![license](https://img.shields.io/github/license/monetjoe/erhu_playing_tech.svg)](./LICENSE)
3+
[![auto-sync](https://github.com/monetjoe/erhu_playing_tech/actions/workflows/auto-sync.yml/badge.svg)](https://github.com/monetjoe/erhu_playing_tech/actions/workflows/auto-sync.yml)
4+
[![hf](https://img.shields.io/badge/huggingface-erhu__playing__tech-ffd21e.svg)](https://huggingface.co/spaces/ccmusic-database/erhu_playing_tech)
5+
[![ms](https://img.shields.io/badge/modelscope-erhu__playing__tech-624aff.svg)](https://modelscope.cn/studios/ccmusic-database/erhu_playing_tech)
26

3-
#### 介绍
4-
{**以下是 Gitee 平台说明,您可以替换此简介**
5-
Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台
6-
无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)}
7-
8-
#### 软件架构
9-
软件架构说明
10-
11-
12-
#### 安装教程
13-
14-
1. xxxx
15-
2. xxxx
16-
3. xxxx
17-
18-
#### 使用说明
19-
20-
1. xxxx
21-
2. xxxx
22-
3. xxxx
23-
24-
#### 参与贡献
25-
26-
1. Fork 本仓库
27-
2. 新建 Feat_xxx 分支
28-
3. 提交代码
29-
4. 新建 Pull Request
30-
31-
32-
#### 特技
33-
34-
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
35-
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
36-
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
37-
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
38-
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
39-
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
7+
二胡演奏技法识别器是一种基于深度学习技术的音频分析工具,旨在自动区分二胡演奏中的不同技法。该模型通过深入分析二胡音乐的声学特征,能够识别出包括分弓、垫弓、泛音、连弓、滑音、大滑音、击弓、拨弦、抛弓、顿弓、颤弓、颤音以及揉弦在内的11种基本演奏技法。通过对音频信号进行时频域转换、特征提取和模式识别,该模型能够准确地对二胡演奏中的复杂技法进行分类,为音乐信息检索、音乐教育以及二胡演奏艺术的研究提供了一种高效的技术支持。此模型的应用不仅丰富了音乐声学领域的研究,也为传统音乐的传承与创新开辟了新的途径。

0 commit comments

Comments
 (0)