MCPcopy Create free account
hub / github.com/tensorflow/tfjs-examples / urlExists

Function urlExists

iris-fitDataset/loader.js:24–32  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

22 * Test whether a given URL is retrievable.
23 */
24export async function urlExists(url) {
25 ui.status('Testing url ' + url);
26 try {
27 const response = await fetch(url, {method: 'HEAD'});
28 return response.ok;
29 } catch (err) {
30 return false;
31 }
32}
33
34/**
35 * Load pretrained model stored at a remote URL.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected