Spaces:
Sleeping
Sleeping
File size: 2,015 Bytes
d9223ba |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"gpuType": "T4"
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
}
},
"cells": [
{
"cell_type": "markdown",
"source": [
"# 🚀 Annotation Assistant - Colab Launcher\n",
"**Instructions:**\n",
"1. Upload all project files (`app.py`, `utils.py`, `requirements.txt`) to the details file area on the left.\n",
"2. Add your Ngrok Authtoken below.\n",
"3. Run all cells."
],
"metadata": {
"id": "intro_md"
}
},
{
"cell_type": "code",
"source": [
"# 1. Install Dependencies\n",
"!pip install -r requirements.txt"
],
"metadata": {
"id": "install_deps"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# 2. Authenticate ngrok\n",
"# REPLACE 'YOUR_TOKEN' WITH YOUR ACTUAL TOKEN\n",
"from pyngrok import ngrok\n",
"ngrok.set_auth_token(\"YOUR_NGROK_AUTHTOKEN_HERE\")"
],
"metadata": {
"id": "auth_ngrok"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# 3. Run the App\n",
"import os\n",
"import time\n",
"from pyngrok import ngrok\n",
"\n",
"# Kill previous tunnels\n",
"ngrok.kill()\n",
"\n",
"# Run Streamlit in background\n",
"get_ipython().system_raw('streamlit run app.py &')\n",
"\n",
"# Open Tunnel\n",
"time.sleep(5) # Wait for start\n",
"public_url = ngrok.connect(8501).public_url\n",
"print(f\"🚀 Application Live at: {public_url}\")"
],
"metadata": {
"id": "run_app"
},
"execution_count": null,
"outputs": []
}
]
} |