Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions .github/workflows/gigaam.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

env:
FORCE_COLOR: 1

jobs:
test:
name: Test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
timeout-minutes: 45

strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y wget ffmpeg libsndfile1 libasound2-dev
ffmpeg -version

- name: Download test audio file
run: |
wget -O example.wav https://cdn.chatwm.opensmodel.sberdevices.ru/GigaAM/example.wav

- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-

- name: Show disk usage before install
run: df -h

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install --no-cache-dir torch==2.8.0 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/cpu
pip install --no-cache-dir -e ".[longform,tests]"

- name: Show disk usage after install
run: df -h

- name: Run model loading tests
run: |
pytest -v tests/test_loading.py -m partial --tb=short

- name: Run audio loading tests
run: |
pytest -v tests/test_reading.py --tb=short

- name: Run batching tests
run: |
pytest -v tests/test_batching.py --tb=short

- name: Run longform tests
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
pytest -v tests/test_longform.py --tb=short

- name: Run onnx tests
run: |
pytest -v tests/test_onnx.py --tb=short

- name: Run all tests with coverage
if: matrix.python-version == '3.10'
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
pytest --cov=gigaam --cov-report=xml --cov-report=term-missing tests/

- name: Upload coverage to Codecov
if: matrix.python-version == '3.10'
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false

lint:
name: Lint and Format Check
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Cache pip dependencies
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-lint-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-lint-

- name: Install linters
run: |
pip install --upgrade pip
pip install flake8 black isort mypy types-requests

- name: Check code formatting with black
run: |
black --check --diff gigaam/ tests/

- name: Check imports with isort
run: |
isort --check-only --diff gigaam/ tests/

- name: Lint with flake8
run: |
flake8 --ignore=E203,W503,W504 --max-line-length=120 --statistics gigaam/ tests/

- name: Type check with mypy
run: |
mypy gigaam/ --ignore-missing-imports --no-strict-optional
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
__pycache__
build
*.egg-info
*.wav
.DS_Store
*tmp*
onnx
.venv
mlx_convert/.venv
mlx_convert/gigaam-v3-ctc-mlx/
mlx_convert/gigaam-v3-ctc-mlx-fp32/
mlx_convert/gigaam-v3-rnnt-mlx/
mlx_convert/ggml-small.bin
mlx_convert/debug_*.py
Binary file removed GigaAM License_NC.pdf
Binary file not shown.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 GigaChat Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading