upload model and demo
This commit is contained in:
16
demo2.py
Normal file
16
demo2.py
Normal file
@ -0,0 +1,16 @@
|
||||
from model import FunASRNano
|
||||
|
||||
|
||||
def main():
|
||||
model_dir = "FunAudioLLM/fun-asr-nano"
|
||||
m, kwargs = FunASRNano.from_pretrained(model=model_dir, device="cuda:0")
|
||||
m.eval()
|
||||
|
||||
wav_path = f"{kwargs['model_path']}/example/zh.mp3"
|
||||
res = m.inference(data_in=[wav_path], **kwargs)
|
||||
text = res[0][0]["text"]
|
||||
print(text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user