In [1]:
!rm -rf build
!wget -q -O frontend.zip https://github.com/vanpelt/emotion-detector/releases/download/stable/frontend.zip
!unzip -q frontend.zip
In [2]:
# Serve our custom UI
!cp -r app/models/ build/
from subprocess import Popen
try:
server.kill()
except NameError:
pass
port = 8010
server = Popen(["cd ./build && python -m http.server %i" % port], shell=True,
stdin=None, stdout=None, stderr=None, close_fds=True)
In [ ]:
import IPython
import getpass
username = getpass.getuser()
html = open("./build/index.html").read()
body = html.replace('="/', '="https://hub2.wandb.us/user/{}/proxy/{}/'.format(username,port),10)
body = body.replace("</head>", '<script type="text/javascript"/>window.BASE_URL = "https://hub2.wandb.us/user/{}/proxy/{}/"</script></head>'.format(username,port))
display(IPython.display.HTML(body))