Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

colab issue #21

Open
maheshs11 opened this issue Mar 7, 2023 · 0 comments
Open

colab issue #21

maheshs11 opened this issue Mar 7, 2023 · 0 comments

Comments

@maheshs11
Copy link

import subprocess
import os; os.makedirs("images", exist_ok=True)
import time
import streamlit as st

Run the diffuzers app

diffuzers_process = subprocess.Popen(["diffuzers", "app", "--host", "localhost", "--port", "8001", "--device", "cuda","--output","/content/images"], stdout=subprocess.PIPE)

time.sleep(30)

Run localtunnel to expose the app to the public

lt_process = subprocess.Popen(["lt", "--port", "8001","--subdomain","myapp"], stdout=subprocess.PIPE)
#lt_process = subprocess.Popen(["ngrok", "http", "8501"], stdout=subprocess.PIPE)

Wait for the localtunnel URL to be generated

lt_url = None
while lt_url is None:
line = lt_process.stdout.readline()
if "https" in line.decode("utf-8"):
lt_url = line.decode("utf-8").strip()

Print the localtunnel URL

print("LocalTunnel URL:", lt_url)

Wait for user input to stop the processes

input("Press enter to stop the processes...")

Terminate the processes

lt_process.terminate()
diffuzers_process.terminate()

i want to use without ngork key or anything else so wrote this, this does not work sometime says connection error and when it does works and i reload the model or page, session state error comes, https://docs.streamlit.io/library/api-reference/session-state

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant