Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 21 additions & 5 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
FROM mcr.microsoft.com/devcontainers/python:3.10
FROM mcr.microsoft.com/devcontainers/python:3.11@sha256:1eb48ffd772f0618d66844eff8cbfd9914785be25f6a936d0756a1ddfc866cc3

ENV PYTHONUNBUFFERED 1
ENV PYTHONUNBUFFERED=1

RUN pipx install poetry==1.8.3
# Apply available OS security fixes, including the CA bundle (CVE-2026-111943)
RUN apt-get update \
&& apt-get upgrade -y --no-install-recommends \
&& apt-get install -y --no-install-recommends --only-upgrade ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# Install pre-commit
RUN pip install pre-commit
# Use the project's locked tools instead of stale copies inherited from the base.
RUN for tool in autopep8 bandit black flake8 mypy pipenv pycodestyle pydocstyle pylint pytest virtualenv yapf; do \
pipx uninstall "$tool"; \
done \
&& pipx install poetry==2.5.1

# Refresh the installer inherited from the base image, then install dev tooling.
RUN python -m pip install --no-cache-dir --upgrade pip setuptools wheel \
&& python -m pip install --no-cache-dir --upgrade "GitPython>=3.1.62" pre-commit \
&& python -m pip --python /usr/local/py-utils/shared/bin/python install --no-cache-dir --upgrade pip setuptools wheel \
&& python -m pip --python /usr/local/py-utils/venvs/pipx/bin/python install --no-cache-dir --upgrade pip setuptools wheel \
&& python -m pip --python /usr/local/py-utils/venvs/poetry/bin/python install --no-cache-dir --upgrade pip setuptools wheel

USER vscode
11 changes: 1 addition & 10 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/java:1": {
"version": "17",
"installMaven": false,
"installGradle": false
}
},
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -35,6 +26,6 @@
}
}
},
"postCreateCommand": "poetry install",
"postCreateCommand": "poetry install --with quality,tests",
"remoteUser": "vscode"
}
7 changes: 5 additions & 2 deletions .github/workflows/_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ concurrency:
cancel-in-progress: true

env:
POETRY_VERSION: "2.1.1"
POETRY_VERSION: "2.5.1"

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
name: "integration_test python v${{ matrix.python-version }}"
Expand All @@ -37,6 +39,7 @@ jobs:
python-version: ${{ matrix.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
cache-key: core
working-directory: .

- name: Install together with dependencies
shell: bash
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ concurrency:
cancel-in-progress: true

env:
POETRY_VERSION: "1.7.1"
POETRY_VERSION: "2.5.1"

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
name: "unittest python v${{ matrix.python-version }}"
Expand All @@ -37,6 +39,7 @@ jobs:
python-version: ${{ matrix.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
cache-key: core
working-directory: .

- name: Install dependencies
shell: bash
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/check_code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

permissions:
contents: read

jobs:
pre-commit:
runs-on: ubuntu-latest
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/upload-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ on:
types: [published]

env:
POETRY_VERSION: "2.1.1"
POETRY_VERSION: "2.5.1"

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
python-version: ["3.11"]

steps:
- uses: actions/checkout@v4
Expand All @@ -22,6 +25,7 @@ jobs:
python-version: ${{ matrix.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
cache-key: core
working-directory: .

- name: Set up cache
uses: actions/cache@v4
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ repos:
- id: check-merge-conflict
- id: check-toml
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 26.10.1
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.8.0'
hooks:
- id: mypy
args: [--strict]
additional_dependencies: [types-requests, types-tqdm, types-tabulate, types-click, types-filelock, types-Pillow, rich, pyarrow-stubs, pydantic, aiohttp]
additional_dependencies: [types-requests, types-tqdm, types-tabulate, types-click, types-filelock, "pillow>=13.0.0,<14", rich, pyarrow-stubs, pydantic, aiohttp]
exclude: ^tests/
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Pull requests cannot land without passing the formatting, linting, and testing c

This project utilizes [Poetry](https://python-poetry.org/) v1.6.1+ as a dependency manager.

❗Note: *Before installing Poetry*, if you use `Conda`, create and activate a new Conda env (e.g. `conda create -n together python=3.10`)
❗Note: *Before installing Poetry*, if you use `Conda`, create and activate a new Conda env (e.g. `conda create -n together python=3.11`)

Install Poetry: **[documentation on how to install it](https://python-poetry.org/docs/#installation)**.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

> Note: You are looking at the codebase for Together Python V1. The latest Together Python SDK can be found **[here.](https://github.com/togethercomputer/together-py)**

The [Together Python API Library](https://pypi.org/project/together/) is the official Python client for Together's API platform, providing a convenient way for interacting with the REST APIs and enables easy integrations with Python 3.10+ applications with easy to use synchronous and asynchronous clients.
The [Together Python API Library](https://pypi.org/project/together/) is the official Python client for Together's API platform, providing a convenient way for interacting with the REST APIs and enables easy integrations with Python 3.11+ applications with easy to use synchronous and asynchronous clients.



Expand Down
1 change: 0 additions & 1 deletion examples/tokenize_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
PreTrainedTokenizerBase,
)


# see default of ignore_index
# for https://pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html#torch.nn.CrossEntropyLoss
LOSS_IGNORE_INDEX = -100
Expand Down
Loading
Loading