Call models by passing a file or URL
-f
flag to pass file input. If you’re using the API endpoint via Python, get file contents with the standard f.read()
function.
-f
flag for truss predict
only applies to JSON-serializable content. For other files, like the audio files required by MusicGen Melody, the file content needs to be base64 encoded before it is sent.
preprocess()
function.
Here’s an example from Whisper in the model library.
>
operator in bash or file.write()
function in Python to save the model output.