Add bi_v100-sensevoice and bi_v100-whisper as subdirectories

This commit is contained in:
zhousha
2025-08-14 09:56:11 +08:00
parent a1bccd4e63
commit 3f260b924c
14 changed files with 82 additions and 7 deletions

BIN
bi_v100-whisper/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1,10 @@
FROM zibo.harbor.iluvatar.com.cn:30000/saas/bi100-3.2.1-x86-ubuntu20.04-py3.10-poc-llm-infer:v1.2.2
RUN mkdir /workspace
WORKDIR /workspace/
COPY asr_server_whisper.py /workspace/asr_server_whisper.py
COPY ./launch_service /workspace/launch_service
COPY whisper-tiny /model
ENTRYPOINT ["./launch_service"]

View File

@@ -0,0 +1,34 @@
import torch
from transformers import pipeline
from flask import Flask, request, jsonify
from threading import Lock
asr_pipeline = pipeline(
task="automatic-speech-recognition",
model="/model",
torch_dtype=torch.float16,
device="cuda:0"
)
app = Flask(__name__)
pipeline_lock = Lock()
@app.route('/recognition', methods=['POST'])
def predict():
audio_data = request.data
params = request.params
params_json = json.loads(params)
lang = params_json.get('language', 'en')
with pipeline_lock:
res = asr_pipeline(inputs=audio_data, generate_kwargs={"language": lang})
text = res['text'].strip()
return jsonify({'RecognitionStatus': 'Success', "DisplayText": text})
@app.route('/ready', methods=['GET'])
@app.route('/health', methods=['GET'])
@app.route('/health_check', methods=['GET'])
def health():
return jsonify({'status': 'ok'})
if __name__ == '__main__':
app.run(host='0.0.0.0', port=80)

9
bi_v100-whisper/launch_service Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
data
cat /proc/cpuinfo
ixsmi
export
date
python3 asr.py

Binary file not shown.

View File

@@ -0,0 +1 @@
Revision:master,CreatedAt:1736300537