Step 1: Install Ollama
Ollama is a platform that allows you to run AI models offline on your computer. Here’s how you can install it on Windows:
Step 2: Download the DeepSeek R1 Model
Once Ollama is installed, download the DeepSeek R1 model.
Step 3: Set Up Python Environment
Now, let's set up the Python environment to use DeepSeek.
Step 4: Run the DeepSeek R1 Model
Now that everything is set up, you can use DeepSeek in your Python scripts.
Here’s an example script to interact with DeepSeek:
Step 5: Execute the Script
Save the script as deepseek_example.py and run it using Command Prompt:
This will execute your script and display the response from the DeepSeek model.
Ollama is a platform that allows you to run AI models offline on your computer. Here’s how you can install it on Windows:
- Visit Ollama's official website.
- Download the Windows executable file (.exe) from the website.
- Double-click the downloaded file to start the installation process.
- Follow the on-screen prompts to complete the installation.
Step 2: Download the DeepSeek R1 Model
Once Ollama is installed, download the DeepSeek R1 model.
- Open Command Prompt on your Windows machine.
- Run the following command to pull the DeepSeek R1 model:
Code:ollama pull deepseek-r1:1.5b
Step 3: Set Up Python Environment
Now, let's set up the Python environment to use DeepSeek.
- Make sure you have Python installed. You can download it from Python's official website.
- Install necessary packages using pip. Open Command Prompt and run:
Code:pip install ollama
Step 4: Run the DeepSeek R1 Model
Now that everything is set up, you can use DeepSeek in your Python scripts.
Here’s an example script to interact with DeepSeek:
Python:
import ollama
# Initialize the model
model = ollama.Model("deepseek-r1:1.5b")
# Define a query
query = "Explain quantum computing in simple terms"
# Get the response from the model
response = model.generate(query)
print(response)
Step 5: Execute the Script
Save the script as deepseek_example.py and run it using Command Prompt:
Code:
python deepseek_example.py
This will execute your script and display the response from the DeepSeek model.