The Huggingface wav2vec ASR incremental modules for the retico framework
Project description
retico-wav2vecasr
Local wav2vec ASR Module for ReTiCo
Example
import retico_core
from retico_wav2vecasr import *
from retico_wav2vecasr.wav2vecasr import Wav2VecASRModule
msg = []
def callback(update_msg):
global msg
for x, ut in update_msg:
if ut == retico_core.UpdateType.ADD:
msg.append(x)
if ut == retico_core.UpdateType.REVOKE:
msg.remove(x)
txt = ""
committed = False
for x in msg:
txt += x.text + " "
committed = committed or x.committed
print(" " * 80, end="\r")
print(f"{txt}", end="\r")
if committed:
msg = []
print("")
microphone = retico_core.audio.MicrophoneModule()
asr = Wav2VecASRModule("en")
m3 = debug.CallbackModule(callback=callback)
microphone.subscribe(asr)
asr.subscribe(m3)
retico_core.network.run(asr)
print("Running the ASR. Press enter to exit")
input()
retico_core.network.stop(asr)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file retico-wav2vecasr-0.1.1.tar.gz
.
File metadata
- Download URL: retico-wav2vecasr-0.1.1.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 087f2a377c16462b71e9a497e6596a7569873dfbbd8f03531a0ede7686ea3006 |
|
MD5 | 6b1f33723b887a185ba3b9dc703e34fc |
|
BLAKE2b-256 | 3a84ee36f8937d335536f55918f91d1a995284445ed6686f34e207617a7117e0 |