28-07-2024
Text Summarizer using Ollama-2:0.5B
Shrutik Dawane
A text summarizer using ollama model 2:0.5B to able to summarizer text accordingly.
-
install ollama from the website
- in CMD write the command pip install ollama
- in CMD write the command ollama run qwen2:0.5b to install it to the locally
-
Install Python
- Download and Install Python (3.5 < version < 3.12)
-
Create a new virtual environment and activate it.
- python3 -m virtualenv venv
- \venv\Scripts\activate
-
Install the following packages using Python Package Manager: requests, ollama, virtualenv
- pip install <package_name> or you can directly install
- pip install -r reqirements.txt to install all the dependencies
-
Pull the Ollama-2.0: 5B Model from the Ollama registry
- pull ollama Ollama-2.0:5B
-
Freeze the requirements to a requirements.txt file for easy access in future project setup.
- pip freeze > requirements.txt
-
Create a new file that contains the text to summarize.
-
Excute the main code file.
- If you want to used input your own text file A. please use this command a. python main.py -t "your text"
- if you want to use a file use this command. A. python main.py --file sample.txt