Skip to content

Schryzon/Kanzeon

Repository files navigation

description

Kanzeon: Clarity, Among Chaos.

license last-commit repo-top-language repo-language-count

Built with the tools and technologies:

JSON Streamlit Docker Python

Table of Contents

  1. Table of Contents
  2. Overview
  3. Features
  4. Project Structure 4.1. Project Index
  5. Getting Started 5.1. Prerequisites 5.2. Installation 5.3. Usage
  6. Contributing
  7. License
  8. Acknowledgments

Overview

A powerful text summarizer built on Google’s pretrained T5-large (via HuggingFace).

This is the backend-focused version of Kanzeon, designed for the UNRAM S-Cube Hackathon 2025.

Utilizes your GPU if CUDA is available, and the CUDA version of Pytorch is installed.


Features

  • πŸ“ General Summarization
    Leverages T5-large to condense any text into clear, concise summaries.

  • πŸ”„ LoRA Adapter Load & Save
    Quickly load previously fine-tuned adapters or persist new ones without retraining the full model.

  • πŸ“Š Status Checks
    /kanzeon/status endpoint shows service health, device type, and VRAM usage.

  • πŸ›‘οΈ Out of Memory Handling
    Auto-falls back to CPU on GPU OOM, then self-heals back to GPU when memory frees up.

  • 🌐 Multilingual Support
    Auto-detects language, translates to English for summarization, then back to the original language.


Project Structure

└── Kanzeon-Backend/
    β”œβ”€β”€ Dockerfile
    β”œβ”€β”€ LICENSE
    β”œβ”€β”€ README.md
    β”œβ”€β”€ backend.py
    β”œβ”€β”€ examples
    β”‚   β”œβ”€β”€ example.pdf
    β”‚   β”œβ”€β”€ mock_data.json
    β”‚   β”œβ”€β”€ mock_data2.json
    β”‚   └── mock_data3.json
    β”œβ”€β”€ frontend.py
    β”œβ”€β”€ img
    β”‚   β”œβ”€β”€ Kanzeon-Banner-Final.jpg
    β”‚   β”œβ”€β”€ Kanzeon1x1-Circle.png
    β”‚   β”œβ”€β”€ Kanzeon1x1-Erased.png
    β”‚   └── Kanzeon1x1.jpg
    β”œβ”€β”€ kanzeon_adapter
    β”‚   β”œβ”€β”€ README.md
    β”‚   β”œβ”€β”€ adapter_config.json
    β”‚   └── adapter_model.safetensors
    β”œβ”€β”€ mock_commands.txt
    β”œβ”€β”€ requirements.txt
    └── test
        β”œβ”€β”€ check_dir.py
        └── test.py

Project Index

KANZEON-BACKEND/
__root__
β¦Ώ __root__
File Name Summary
Dockerfile Contains the Dockerfile used to containerize the Kanzeon API and its runtime dependencies.
mock_commands.txt Lists sample cURL commands and usage examples for testing all Kanzeon endpoints.
LICENSE The MIT License governing usage, modification, and distribution of this project.
requirements.txt Specifies all required Python packages and their versions for both the backend and frontend.
frontend.py Streamlit application that provides a user interface to interact with the Kanzeon API.
backend.py Main Quart-based server implementation defining the Kanzeon class, routes and summarization logic.
test
β¦Ώ test
File Name Summary
check_dir.py A two-line script to find the location of the installed models from HuggingFace.
test.py Initial testing script for the pipeline (no routes implemented).
kanzeon_adapter
β¦Ώ kanzeon_adapter
File Name Summary
adapter_config.json JSON file containing the LoRA adapter configuration parameters used for fine-tuning.
adapter_model.safetensors Binary file storing the fine-tuned LoRA adapter weights.
examples
β¦Ώ examples
File Name Summary
mock_data.json Sample JSON payload for a basic text summarization request #1.
mock_data2.json Sample JSON payload for a basic text summarization request #2.
mock_data3.json Sample JSON payload for a basic text summarization request #3.

Getting Started

Prerequisites

This project requires the following dependencies:

  • Programming Language: Python
  • Package Manager: Pip
  • Container Runtime: Docker

Installation

Build Kanzeon-Backend from the source and intsall dependencies:

  1. Clone the repository:

    ❯ git clone https://github.com/Schryzon/Kanzeon-Backend
  2. Navigate to the project directory:

    ❯ cd Kanzeon-Backend
  3. (Optional) Create & activate a virtualenv (if you plan to use pip):

    ❯ python3 -m venv .venv
    ❯ source .venv/bin/activate
  4. Install the dependencies:

    Using Docker (Recommended):

    Make sure you have Docker Engine, Docker Compose, and the NVIDIA Container Toolkit (for GPU support) installed.

    i. With GPU Support

    ❯ docker-compose up --build

    ii. Without GPU Support

    ❯ docker build -t Schryzon/Kanzeon-Backend .

    Using pip:

    i. With GPU Support

    ❯ pip install -r requirements-cuda.txt

    ii. Without GPU Support

    ❯ pip install -r requirements-nocuda.txt

Usage

Run the project with:

Using Docker:

❯ docker run -it Schryzon/Kanzeon-Backend

Using pip:

❯ python backend.py
❯ streamlit run frontend.py --server.port=8501 --server.address=0.0.0.0

Contributing

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    ❯ git clone https://github.com/Schryzon/Kanzeon-Backend
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    ❯ git checkout -b new-feature-x
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    ❯ git commit -m 'Implemented new feature!'
  6. Push to github: Push the changes to your forked repository.
    ❯ git push origin new-feature-x
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


License

Kanzeon-backend is protected under the MIT LICENSE License. For more details, refer to the LICENSE file.


Acknowledgments

  • Thanks to Selia and Xelisa for teaching me how to make this! ❀️


About

Clarity, among chaos.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors