So currently I'm working on a web application that uses a model I built previously. I have the file stored locally in my github repository and I'm trying to retrieve that model and load it into a variable as so
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@2.0.0/dist/tf.min.js"></script>
<script>
const model = await tf.loadLayersModel('https://foo.bar/tfjs_artifacts/model.json');
</script>
The first script tag should load in the tensorflow.js library (https://www.tensorflow.org/js/tutorials/setup).
The error that appears in the terminal is
Uncaught SyntaxError: await is only valid in async function
Am I missing something with the tensorflow.js implementation? Or am I missing something with the await keyword in the model assignment?