This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
os.chdir('<git-directory>') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!git clone <path-to-page> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!git config --global user.email "email" | |
!git config --global user.name "user" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!git add . | |
!git commit -m "create xor project" | |
!git push <token>:[email protected]/<path-to-page> master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with open('index.html','w') as f: | |
f.write(header+script+body) | |
f.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body = '\ | |
<body>\n\ | |
<p id =\'out\'></p> \n\ | |
</body>' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
header = '<head><script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]"> </script>\n' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!tensorflowjs_converter --input_format keras saved_model/keras.h5 web_model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!pip install tensorflowjs |