facebookresearch / seamless_communication

Foundational Models for State-of-the-Art Speech and Text Translation
Other
10.53k stars 1.02k forks source link

Missing asset card #33

Closed astrowar closed 10 months ago

astrowar commented 10 months ago

After several adjustments and adaptations in the repository, I was able to compile the source code in Ubuntu. However, the execution gives an error because the program does not find the CARD of the model. I imagine that the documentation is missing some step on how to setup for inference only.

(voz) astro@ubuntu:~/dev/voz/fix/seamless_communication$ m4t_predict  "seu tolo, nao sei de nada" t2tt en --src_lang pt
2023-08-22 22:46:12,134 INFO -- m4t_scripts.predict.predict: Running inference on the CPU.
Traceback (most recent call last):
  File "/home/astro/dev/voz/fix/fairseq2/src/fairseq2/assets/card_storage.py", line 76, in load_card
    fp = open(pathname)
FileNotFoundError: [Errno 2] No such file or directory: '/home/astro/dev/voz/voz/lib/python3.8/site-packages/seamless_communication/assets/cards/seamlessM4T_large.yaml'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/astro/dev/voz/voz/bin/m4t_predict", line 8, in <module>
    sys.exit(main())
  File "/home/astro/dev/voz/voz/lib/python3.8/site-packages/m4t_scripts/predict/predict.py", line 69, in main
    translator = Translator(args.model_name, args.vocoder_name, device)
  File "/home/astro/dev/voz/voz/lib/python3.8/site-packages/seamless_communication/models/inference/translator.py", line 60, in __init__
    self.model: UnitYModel = load_unity_model(
  File "/home/astro/dev/voz/fix/fairseq2/src/fairseq2/models/utils/model_loader.py", line 175, in __call__
    card = self.asset_store.retrieve_card(model_name_or_card)
  File "/home/astro/dev/voz/fix/fairseq2/src/fairseq2/assets/store.py", line 101, in retrieve_card
    data = self._storage.load_card(name)
  File "/home/astro/dev/voz/fix/fairseq2/src/fairseq2/assets/card_storage.py", line 78, in load_card
    raise AssetCardNotFoundError(
fairseq2.assets.card_storage.AssetCardNotFoundError: An asset card with the name 'seamlessM4T_large' cannot be found.
dluna1150 commented 10 months ago

same problem here

cndn commented 10 months ago

Hey @astrowar @dluna1150 could you try if updating this line https://github.com/facebookresearch/seamless_communication/blob/main/setup.py#L53 to package_data={"": ["assets/cards/*.yaml"]}, and reinstall unblocks you?

davedgd commented 10 months ago

@cndn: This indeed allows the models to be fetched -- thank you!

cndn commented 10 months ago

@cndn: This indeed allows the models to be fetched -- thank you!

Thanks for confirming. I merged https://github.com/facebookresearch/seamless_communication/pull/35.