{"id":23925537,"url":"https://github.com/jenslys/ai-summarizer","last_synced_at":"2026-05-08T13:07:07.870Z","repository":{"id":243236363,"uuid":"811833717","full_name":"jenslys/ai-summarizer","owner":"jenslys","description":"Flask web app that uses a custom Norwegian trained Llama model to summarize text.","archived":false,"fork":false,"pushed_at":"2024-06-08T11:26:44.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-05T20:14:35.803Z","etag":null,"topics":["ai","flask","huggingface","ollama","python","ruter"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenslys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-07T11:52:46.000Z","updated_at":"2024-06-08T11:26:48.000Z","dependencies_parsed_at":"2024-06-07T14:44:23.215Z","dependency_job_id":null,"html_url":"https://github.com/jenslys/ai-summarizer","commit_stats":null,"previous_names":["jenslys/ai-summarizer"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslys%2Fai-summarizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslys%2Fai-summarizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslys%2Fai-summarizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenslys%2Fai-summarizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenslys","download_url":"https://codeload.github.com/jenslys/ai-summarizer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240395746,"owners_count":19794572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","flask","huggingface","ollama","python","ruter"],"created_at":"2025-01-05T20:14:41.247Z","updated_at":"2026-05-08T13:07:02.827Z","avatar_url":"https://github.com/jenslys.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI-Summarizer\n\nA simple web application that uses a custom Llama model specifically tuned for Norwegian text by [RuterNorway](https://huggingface.co/RuterNorway/Llama-2-13b-chat-norwegian). The application allows the user to input text and receive a summarized version.\n\n## Demo\n\n[YouTube Demo](https://youtu.be/MDeIGoIzg00)\n\n## Prerequisites\n\n### Ollama\n\n- [Install Ollama](https://ollama.com/)\n- Serve Ollama using `ollama serve`\n\n### Custom Ollama Model\n\n1. **Download the Model**:\n   - Download the quantized GGUF version of the model from [Hugging Face](https://huggingface.co/jankovicsandras/Llama-2-13b-chat-norwegian-Q5_K_M-GGUF)\n   - Drag the model file into the `models` folder\n   - Rename the model file to `llama-2-13b-chat-norwegian.gguf`\n\n2. **Create a Model File**:\n   - Create a model file with the following content:\n\n     ```sh\n     # set the base model\n     FROM llama-2-13b-chat-norwegian.gguf\n\n     # Set custom parameter values\n     PARAMETER temperature 0.7\n\n     # Define stop tokens to ensure proper parsing of sections\n     PARAMETER stop  \u003c/\u003e\n     PARAMETER stop  \u003c/\u003e\n     PARAMETER stop  \u003c/\u003e\n     PARAMETER stop \u003c|reserved_special_token|\u003e\n\n     # Set the model template to handle summarization\n     TEMPLATE \"\"\"\n     {{ if .System }} \u003c/system\u003e\n     {{ .System }}{{ end }}\n     {{ if .Prompt }} \u003c/user\u003e\n     {{ .Prompt }}{{ end }}\n     \u003c/assistant\u003e\n     {{ .Response }}\n     \"\"\"\n\n     SYSTEM Du er en erfaren journalist. Svar med en kort og nøyaktig oppsummering av informasjonen som er gitt.\n     ```\n\n3. **Create the Custom Ollama Model**:\n   - Run the following command to create the custom model:\n\n     ```sh\n     ollama create llama-nor -f .modelfile\n     ```\n\n### Python Dependencies\n\n- Install Python dependencies using:\n\n  ```sh\n  pip install -r requirements.txt\n  ```\n\n## Running the Application\n\n1. **Start the Flask Application**:\n\n   ```sh\n   python main.py\n   ```\n\n2. **Open the Web Application**:\n   - Open your web browser and navigate to `http://127.0.0.1:5000`.\n\n## Usage\n\n- Enter the text you want to summarize in the \"Tekst å summere\" field.\n- Click the \"Summer\" button.\n- The summarized text will appear in the \"Sammendrag\" field.\n\n## Architecture\n\n### Overview\n\nThe application consists of the following components:\n\n1. **Frontend**: A simple HTML form where users can input text and receive the summarized output.\n2. **Backend**: A Flask server that handles requests from the frontend and interacts with the Ollama model.\n3. **Model**: A custom Llama model fine-tuned for Norwegian text summarization.\n\n### Data Flow\n\n1. **User Input**: The user enters text into the input field on the web page.\n2. **Request Handling**: The frontend sends the input text to the Flask backend via an HTTP POST request.\n3. **Model Interaction**: The Flask server processes the input and sends it to the Ollama model for summarization.\n4. **Response Handling**: The Ollama model returns the summarized text to the Flask server.\n5. **Display Output**: The Flask server sends the summarized text back to the frontend, where it is displayed to the user.\n\n## References\n\n- [RuterNorway/Llama-2-13b-chat-norwegian](https://huggingface.co/RuterNorway/Llama-2-13b-chat-norwegian)\n  - [Quantized GGUF Model](https://huggingface.co/jankovicsandras/Llama-2-13b-chat-norwegian-Q5_K_M-GGUF)\n- [Ollama Python Library](https://github.com/ollama/ollama-python)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenslys%2Fai-summarizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenslys%2Fai-summarizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenslys%2Fai-summarizer/lists"}