Friday, March 14, 2025

Run ai model in python code with ollama

 First download and install ollama By this blog:
Tech Journey With Gagan: Run Any AI Model with ollama in windows

For Use AI model in python:
1. run this script
Note: this example for mistral ai model please change acording to your model

Declare function


For run

it is work like this


Option 2: 
Run server explicitly 

1. Click on Quit Ollama


2. run server with ollama serve mean in cmd type "ollama serve".



No comments:

Post a Comment

How to Do Cross-Browser Testing on Windows — Including Safari via Playwright

To test follow few steps: Step 1. Install node Step 2. create Folder and run these commands commands Copy Code ...