HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
google
gemma_pytorch
Python2024–2024
google / gemma_pytorch · Archived

gemma_pytorch

The official PyTorch implementation of Google's Gemma models

3Distinct people
4Mentions
0Explicit recommenders
5.7KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

The official PyTorch implementation of Google's Gemma models

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by hour4 dated mentions

Observed mentions: 2024-02-21 16:24:48 UTC to 2024-02-21 20:09:38 UTC.

0122024-02-21 16:00:00 UTC to 2024-02-21 17:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 commentsFeb 21, 16:002024-02-21 17:00:00 UTC to 2024-02-21 18:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-21 18:00:00 UTC to 2024-02-21 19:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsFeb 21, 18:002024-02-21 19:00:00 UTC to 2024-02-21 20:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2024-02-21 20:00:00 UTC to 2024-02-21 21:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 commentsFeb 21, 20:00

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Feb 21, 16:002024-02-21 16:00:00 UTC2024-02-21 17:00:00 UTC202
Feb 21, 17:002024-02-21 17:00:00 UTC2024-02-21 18:00:00 UTC000
Feb 21, 18:002024-02-21 18:00:00 UTC2024-02-21 19:00:00 UTC101
Feb 21, 19:002024-02-21 19:00:00 UTC2024-02-21 20:00:00 UTC000
Feb 21, 20:002024-02-21 20:00:00 UTC2024-02-21 21:00:00 UTC110

What Hacker News says

4 sources
Andrej Karpathy's take from twitter. (https://twitter.com/karpathy/status/1760350892317098371) Seeing as I published my Tokenizer video yesterday, I thought it could be fun to take a deepdive into the Gemma tokenizer. First, the Gemma technical report [pdf]: https://storage.googleapis.com/deepmind-media/gemma/gemma-re... says: "We use a subset of the SentencePiece tokenizer (Kudo and Richardson, 2018) of Gemini for com- patibility. It splits digits, does not remove extra whitespace, and relies on byte-level encodings for unknown tokens, following the techniques used for both (Chowdhery et al., 2022) and (Gemini Team, 2023). The vocabulary size is 256k tokens." The tokenizer.model file is with this code release: https://github.com/google/gemma_pytorch/blob/main/tokenizer/... I decoded this model protobuf in Python and here is the diff wi
Read the rest
th the Llama 2 tokenizer: https://diffchecker.com/TRnbKRMH/ Notes: - vocab size is quite large: 32K -> 256K - add_dummy_prefix is False. Different from Llama but consistent with GPT. This is a bit more consistent w.r.t. "leave the data alone", as there is no preprocessing step that adds a space to the encoding text. - the model_prefix is the path of the training dataset, which is amusing to look at: "/cns/mf-d/home/gemini-data-access/tokenizers/final_v1_51GB_run1/bpe_coverage_0_999995_v5/255969". Seems to indicate the tokenizer training corpus was ~51GB (?). - a lot of user_defined symbols (i.e. special tokens) are present, e.g. "hardcoding" a sequence of up to 31 newlines as tokens, and a large number of other unclear tokens. I tried decoding the octal representations but it's not clear what's happening here. Also a lot of more special tokens for what look like html elements, e.g. <table>, <tr>, <td>, <i>, <b>, etc. Not 100% sure what the unused tokens are for, maybe this is pre-allocated space to make easier future finetunes that try to add more special tokens, as there is no need to resize vocabularies and perform model surgeries (?). TLDR this is basically the Llama 2 tokenizer, except bigger (32K -> 256K), with a lot more special tokens, and the only functional departure is that add_dummy_prefix is turned off to False. So e.g. tokenizing: "hello world" becomes: [17534, 2134] ['hello', 'world'] which otherwise would have been preprocessed to " hello world" (note leading space) and tokenized as: [25612, 2134] ['hello', 'world'] cool
In Gemma: New Open Models

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.