Skip to content

Commit

Permalink
more cli for speech demos
Browse files Browse the repository at this point in the history
  • Loading branch information
zh794390558 committed Jul 12, 2022
1 parent c21daff commit caaa5cd
Show file tree
Hide file tree
Showing 19 changed files with 44 additions and 20 deletions.
Empty file modified demos/custom_streaming_asr/setup_docker.sh
100644 → 100755
Empty file.
Empty file modified demos/keyword_spotting/run.sh
100644 → 100755
Empty file.
Empty file modified demos/speaker_verification/run.sh
100644 → 100755
Empty file.
18 changes: 17 additions & 1 deletion demos/speech_recognition/run.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
#!/bin/bash

wget -c https://paddlespeech.bj.bcebos.com/PaddleAudio/zh.wav https://paddlespeech.bj.bcebos.com/PaddleAudio/en.wav
wget -c https://paddlespeech.bj.bcebos.com/PaddleAudio/zh.wav
wget -c https://paddlespeech.bj.bcebos.com/PaddleAudio/en.wav

# asr
paddlespeech asr --input ./zh.wav


# asr + punc
paddlespeech asr --input ./zh.wav | paddlespeech text --task punc


# asr help
paddlespeech asr --help


# english asr
paddlespeech asr --lang en --model transformer_librispeech --input ./en.wav

# model stats
paddlespeech stats --task asr


# paddlespeech help
paddlespeech --help
Empty file modified demos/speech_server/asr_client.sh
100644 → 100755
Empty file.
Empty file modified demos/speech_server/cls_client.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion demos/speech_server/server.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

paddlespeech_server start --config_file ./conf/application.yaml
paddlespeech_server start --config_file ./conf/application.yaml &> server.log &
10 changes: 10 additions & 0 deletions demos/speech_server/sid_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

wget -c https://paddlespeech.bj.bcebos.com/vector/audio/85236145389.wav
wget -c https://paddlespeech.bj.bcebos.com/vector/audio/123456789.wav

# sid extract
paddlespeech_client vector --server_ip 127.0.0.1 --port 8090 --task spk --input ./85236145389.wav

# sid score
paddlespeech_client vector --server_ip 127.0.0.1 --port 8090 --task score --enroll ./85236145389.wav --test ./123456789.wav
4 changes: 4 additions & 0 deletions demos/speech_server/text_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash


paddlespeech_client text --server_ip 127.0.0.1 --port 8090 --input 今天的天气真好啊你下午有空吗我想约你一起去吃饭
Empty file modified demos/speech_server/tts_client.sh
100644 → 100755
Empty file.
File renamed without changes.
Empty file modified demos/streaming_asr_server/run.sh
100644 → 100755
Empty file.
7 changes: 3 additions & 4 deletions demos/streaming_asr_server/server.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
export CUDA_VISIBLE_DEVICE=0,1,2,3
export CUDA_VISIBLE_DEVICE=0,1,2,3
#export CUDA_VISIBLE_DEVICE=0,1,2,3

# nohup python3 punc_server.py --config_file conf/punc_application.yaml > punc.log 2>&1 &
# nohup python3 local/punc_server.py --config_file conf/punc_application.yaml > punc.log 2>&1 &
paddlespeech_server start --config_file conf/punc_application.yaml &> punc.log &

# nohup python3 streaming_asr_server.py --config_file conf/ws_conformer_wenetspeech_application.yaml > streaming_asr.log 2>&1 &
# nohup python3 local/streaming_asr_server.py --config_file conf/ws_conformer_wenetspeech_application.yaml > streaming_asr.log 2>&1 &
paddlespeech_server start --config_file conf/ws_conformer_wenetspeech_application.yaml &> streaming_asr.log &

2 changes: 1 addition & 1 deletion demos/streaming_asr_server/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ paddlespeech_client asr_online --server_ip 127.0.0.1 --port 8090 --input ./zh.wa

# read the wav and call streaming and punc service
# If `127.0.0.1` is not accessible, you need to use the actual service IP address.
paddlespeech_client asr_online --server_ip 127.0.0.1 --port 8290 --punc.server_ip 127.0.0.1 --punc.port 8190 --input ./zh.wav
paddlespeech_client asr_online --server_ip 127.0.0.1 --port 8090 --punc.server_ip 127.0.0.1 --punc.port 8190 --input ./zh.wav

3 changes: 0 additions & 3 deletions demos/streaming_tts_server/start_server.sh

This file was deleted.

9 changes: 0 additions & 9 deletions demos/streaming_tts_server/test_client.sh

This file was deleted.

8 changes: 7 additions & 1 deletion demos/text_to_speech/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@
paddlespeech tts --input 今天的天气不错啊

# Batch process
echo -e "1 欢迎光临。\n2 谢谢惠顾。" | paddlespeech tts
echo -e "1 欢迎光临。\n2 谢谢惠顾。" | paddlespeech tts

# Text Frontend
paddlespeech tts --input 今天是2022/10/29,最低温度是-3℃.



1 change: 1 addition & 0 deletions paddlespeech/server/bin/paddlespeech_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,7 @@ def __call__(self,
logger.info(f"the input audio: {input}")
handler = VectorHttpHandler(server_ip=server_ip, port=port)
res = handler.run(input, audio_format, sample_rate)
logger.info(f"The spk embedding is: {res}")
return res
elif task == "score":
from paddlespeech.server.utils.audio_handler import VectorScoreHttpHandler
Expand Down

0 comments on commit caaa5cd

Please sign in to comment.