Spaces:
Runtime error
Runtime error
import streamlit as st | |
import os | |
from pyngrok import ngrok | |
import random | |
ngrok.set_auth_token("1T1Qgdhjtcgt9qsAeJoIkJFREiE_6fxnYfcsDQizRGRZ63iGW") | |
port = random.randint(10000, 99999) | |
st.write("previous_tunnels: ", ngrok.get_tunnels()) | |
os.system(f""" | |
jupyter lab --ip 0.0.0.0 --port {port} --allow-root --NotebookApp.token='' --NotebookApp.password='' & | |
""") | |
st.write(f"localhost:{port}") | |
tunnel = ngrok.connect(f"{port}") | |
st.write("URL:", tunnel.public_url) | |