---
title: "fromGpt2"
sidebar_label: "fromGpt2"
description: "Kotlin binding reference: fromGpt2."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../../index.md)/[io.clika.runtime](../../index.md)/[Tokenizer](../index.md)/[Companion](index.md)/[fromGpt2](fromGpt2.md)

# fromGpt2

[common]\
fun [fromGpt2](fromGpt2.md)(directory: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)): [Tokenizer](../index.md)

Load a GPT-2 style byte-level BPE tokenizer from a directory holding `vocab.json` and `merges.txt`.