facebookresearch / fairseq2

FAIR Sequence Modeling Toolkit 2
https://facebookresearch.github.io/fairseq2/
MIT License
623 stars 62 forks source link

Error when using file:// URI in asset card yaml #6

Closed jgwinnup closed 10 months ago

jgwinnup commented 10 months ago

Hi - I'm evaluating seamless-m4t and am trying to load a model checkpoint locally. When I specify a file:// URI I get the following error:

fairseq2.assets.card.AssetCardError: The value of the field 'checkpoint' of the asset card 'seamlessM4T_large' must be a valid URI, but is 'file:///foo/bar/seamless-m4t-large/multitask_unity_large.pt' instead.

I can work around this by starting up a python http.server and serve the file locally, but it would be nice to have proper file:// URI support.

_Originally posted by @jgwinnup in https://github.com/facebookresearch/seamless_communication/issues/50#issuecomment-1691826580_

cbalioglu commented 10 months ago

Hey @jgwinnup, could you please try file://foo/bar/seamless-m4t-large/multitask_unity_large.pt? Note that there are only two slashes after file:. Due to security reasons, our asset cards always expect a full path to be specified. Let me know how that goes. If it does not work, we can investigate it further.

jgwinnup commented 10 months ago

Looks like two slashes fixed the problem. Made a note about full paths, thanks for the help!

dawit3228 commented 4 months ago

Hey @jgwinnup, could you please try file://foo/bar/seamless-m4t-large/multitask_unity_large.pt? Note that there are only two slashes after file:. Due to security reasons, our asset cards always expect a full path to be specified. Let me know how that goes. If it does not work, we can investigate it further.

can u help me with the path

checkpoint: "Models/seamlessM4T_v2_large.pt"
vocoder_path = "/Models/vocoder_v2.pt"

translator = Translator(
    model_name_or_card=checkpoint,
    vocoder_name_or_card=vocoder_path,
    device=torch.device("cuda:0"),
    dtype=torch.float16,
)

and here is the error

(kiya_api) david@davemoment:~/Documents/Projects/KIYA/src$ python STT.py 
Traceback (most recent call last):
  File "/home/david/Documents/Projects/KIYA/src/STT.py", line 31, in <module>
    model_name_or_card=checkpoint,
NameError: name 'checkpoint' is not defined. Did you mean: 'breakpoint'?