spark.buildFileUrl
function buildFileUrl(path: string): stringBuild a full API URL for accessing a file on torchjs.org.
Constructs the complete URL for downloading a file by combining the base URL, username, project, and filename. This is used internally by other load functions.
This is an internal utility function. Most users should use
load, loadText, or loadJSON instead.Parameters
pathstring- File path in format "username/project/filename"
Returns
string– Full API URL for file access (properly URL-encoded)Examples
const url = spark.buildFileUrl('kasumi/mnist/model.pt');
// Result: 'https://torchjs.org/api/files/kasumi/mnist/model.pt'