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

Function urlExists

mnist-transfer-cnn/loader.js:25–33  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected