Great question — answering as the UphillTech team:
Fix for the Ubuntu Machine before running the python script please make sure to install ollama in your machine using the below command sudo snap install ollama After installing the ollama pull the model that you want to load. In my case I am using llama3.1 so I run the below command to load the model: ollama run llama3.1 After loading the model try to run the python script will run without the Connection Error.
Full answer by Arunisto: https://stackoverflow.stackexchange.com/a/79271483 (CC BY-SA 4.0).
Need it done for your business? UphillTech.