Commit d51ef396 authored by chameera's avatar chameera

Upload New File API files

parent 3cf3f87f
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"mount_file_id":"1FSu_DqUS2ttLaFM1iM8QaJziRJSnR3Cl","authorship_tag":"ABX9TyPiIQ5ZMtK7bm/628m4tY+q"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"markdown","source":["Install needed library\n"],"metadata":{"id":"mwbmiUYBmgKm"}},{"cell_type":"code","execution_count":null,"metadata":{"id":"7RvgD1mXl56G"},"outputs":[],"source":["!pip install -r /content/drive/MyDrive/Work_space/Silverline_IT/Project/Learn_Joy/API/app/requirements.txt"]},{"cell_type":"code","source":["!pip install --upgrade transformers -q\n","!pip install git+https://github.com/huggingface/transformers.git -q"],"metadata":{"id":"b8IOSehPuu8x"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["!pip freeze"],"metadata":{"id":"tz8e0SHupyjG"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["from fastapi import FastAPI\n","import uvicorn\n","from pyngrok import ngrok\n","import nest_asyncio\n","from colabcode import ColabCode\n","from pydantic import BaseModel"],"metadata":{"id":"MtgKqWRemtNO"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["Auth token"],"metadata":{"id":"tjwFR3ilmyRW"}},{"cell_type":"code","source":["ngrok.set_auth_token(\"XXXXXXXXXXXXXXXXXXXXXXXXXX\")"],"metadata":{"id":"VeJuUarMmvzh","executionInfo":{"status":"ok","timestamp":1706007838021,"user_tz":-330,"elapsed":852,"user":{"displayName":"Kaushi Gihan","userId":"11214181140146971518"}},"colab":{"base_uri":"https://localhost:8080/"},"outputId":"938a3eb5-2314-4b9c-ecba-6561e70cfab0"},"execution_count":null,"outputs":[{"output_type":"stream","name":"stdout","text":[]}]},{"cell_type":"code","source":["import sys\n","sys.path.append('/content/drive/MyDrive/Work_space/Silverline_IT/Project/Learn_Joy/API/app')\n","import main"],"metadata":{"id":"shISBWBsJYif"},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":["FastAPI run public server\n","\n","\n"],"metadata":{"id":"FjkQBKzsm5Q9"}},{"cell_type":"code","source":["ngrok_tunnel = ngrok.connect(8000)\n","print('Public URL:', ngrok_tunnel.public_url)\n","nest_asyncio.apply()\n","uvicorn.run(\"main:app\", port=8000)"],"metadata":{"id":"2lZn-LJum25D"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["ngrok.disconnect(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")"],"metadata":{"id":"ZQVM4uVfnGMy"},"execution_count":null,"outputs":[]}]}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment