wq2012 commited on
Commit
6e0ba11
1 Parent(s): 58c6c62

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -2
README.md CHANGED
@@ -41,10 +41,21 @@ pip install sidlingvo
41
  Example usage:
42
 
43
  ```Python
44
- import sidlingvo
 
 
 
 
 
 
 
 
45
 
46
  wav_file = "your_wav_file.wav"
47
- runner = wav_to_lang.WavToLangRunner()
 
 
 
48
  top_lang, _ = runner.wav_to_lang(wav_file)
49
  print("Predicted language:", top_lang)
50
  ```
 
41
  Example usage:
42
 
43
  ```Python
44
+ import os
45
+ from sidlingvo import wav_to_lang
46
+ from huggingface_hub import hf_hub_download
47
+
48
+ repo_id = "tflite-hub/conformer-lang-id"
49
+ model_path = "models"
50
+ hf_hub_download(repo_id=repo_id, filename="vad_short_model.tflite", local_dir=model_path)
51
+ hf_hub_download(repo_id=repo_id, filename="vad_short_mean_stddev.csv", local_dir=model_path)
52
+ hf_hub_download(repo_id=repo_id, filename="conformer_langid_medium.tflite", local_dir=model_path)
53
 
54
  wav_file = "your_wav_file.wav"
55
+ runner = wav_to_lang.WavToLangRunner(
56
+ vad_model_file=os.path.join(model_path, "vad_short_model.tflite"),
57
+ vad_mean_stddev_file=os.path.join(model_path, "vad_short_mean_stddev.csv"),
58
+ langid_model_file=os.path.join(model_path, "conformer_langid_medium.tflite"))
59
  top_lang, _ = runner.wav_to_lang(wav_file)
60
  print("Predicted language:", top_lang)
61
  ```