Skip to content

Instantly share code, notes, and snippets.

@zaidalyafeai
Created August 8, 2018 23:23
Show Gist options
  • Save zaidalyafeai/8b9c19dccbdfa349f1858d9508c27230 to your computer and use it in GitHub Desktop.
Save zaidalyafeai/8b9c19dccbdfa349f1858d9508c27230 to your computer and use it in GitHub Desktop.
script = '\
<script>\n\
async function loadModel(){ \n\
model = await tf.loadModel(\'web_model/model.json\') \n\
y = model.predict(tf.zeros([1,2])) \n\
document.getElementById(\'out\').innerHTML = y.dataSync()[0] \n\
} \n\
loadModel() \n\
</script>\n\
</head> \n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment