Skip to content

Instantly share code, notes, and snippets.

View knyazer's full-sized avatar
🐈‍⬛

Roman Knyazhitskiy knyazer

🐈‍⬛
View GitHub Profile
@knyazer
knyazer / distill_dataset.py
Last active May 12, 2026 15:08
interface for distillation dataset
class PromptStore:
path: Path
name: str # dataset name
hash: str # block-wise hash of the mixture or smth like that
@classmethod
def init(cls, path: Path):
# load the dataset, dump into the path with some mixing
# or not load it, but just reuse from the path + some heuristic way to check that metadata matches remote
@eqx.filter_jit
def _make_chunks(
self,
token_ids: Int[Array, "batch tokens"],
lengths_without_padding: Int[Array, " batch"] | None,
chunk_size: int,
) -> Chunk:
batch_size, sequence_length = token_ids.shape
if lengths_without_padding is None:
@knyazer
knyazer / log.txt
Created January 23, 2026 21:10
blowing on 3.12.12
Using CPython 3.12.12
Removed virtual environment at: .venv
Creating virtual environment at: .venv
Installed 158 packages in 119ms
===================================================== test session starts =====================================================
platform linux -- Python 3.12.12, pytest-9.0.1, pluggy-1.6.0
rootdir: /home/knyaz/workspace/lalamo
configfile: pyproject.toml
plugins: anyio-4.11.0, hypothesis-6.150.0, jaxtyping-0.3.3, xdist-3.8.0, env-1.2.0
collected 163 items
@knyazer
knyazer / add_to_fish_config.fish
Last active January 21, 2025 21:51
Bringing AI to Git commit.
function gcm
# Check if llm is installed, if not, install it
if not type -q llm
echo "'llm' is not installed. Attempting to install it using pip..."
if pip install llm
echo "'llm' installed successfully."
else
echo "Failed to install 'llm'. Please install it manually and try again."
return 1
end