Great question — answering as the UphillTech team:
Since, google colab can not run multiple cells simultaneously, so we need to run ollama serve as a background process within the Colab environment. This can be achieved by using subprocesses and asynchronous execution. async def run_ollama(): process = subprocess.Popen("ollama serve", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) while True: await asyncio.sleep(1) Use this colab file, and more resources .
Full answer by imvickykumar999: https://stackoverflow.stackexchange.com/a/79417602 (CC BY-SA 4.0).
Need it done for your business? UphillTech.