VideoLingo_colab.ipynb
!git clone https://github.com/Huanshere/VideoLingo.git
%cd VideoLingo
this takes around 4 mins
!python install.py
After completing these steps, please fill in your ngrok token in the next section of code and proceed.
ๅฎๆ่ฟไบๆญฅ้ชคๅ๏ผ่ฏทๅจไธไธ่ไปฃ็ ไธญๅกซๅ ฅๆจ็ ngrok ไปค็ๅนถ็ปง็ปญใ
!pip install pyngrok
from pyngrok import ngrok
#! SET Ngrok Authtoken Here
ngrok.set_auth_token("YOUR_TOKEN_HERE")
Click the NgrokChannel URL to start your VideoLingo Journey.
tips: You can set your Language down the sidebar on the left.
import subprocess
import threading
import sys
from pyngrok import ngrok
from rich import print as rprint
from rich.panel import Panel
def print_output(process):
for line in iter(process.stdout.readline, ''):
sys.stdout.write(line)
for line in iter(process.stderr.readline, ''):
sys.stderr.write(line)
# Start Streamlit
streamlit_process = subprocess.Popen(
["streamlit", "run", "st.py"],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
bufsize=1
)
# Create and start the output printing thread
output_thread = threading.Thread(target=print_output, args=(streamlit_process,))
output_thread.start()
# Create a tunnel using ngrok
public_url = ngrok.connect(8501)
rprint(Panel(f"Streamlit is available at Ngrok โฌ๏ธ", expand=False))
print(f"Click ๐ {public_url}")
# Keep the program running
ngrok_process = ngrok.get_ngrok_process()
try:
streamlit_process.wait()
except KeyboardInterrupt:
print("Interrupted by user, shutting down...")
finally:
ngrok.kill()
streamlit_process.terminate()
output_thread.join()