     }
 
     public init(
-        bpe: BytePairEncoder,
+        bpe: BytePairEncoder? = nil,
         variant: TextUnsupervisedVariant = TextUnsupervisedVariant.wikiText2,
         trainingBatchSize: Int = 8, validationBatchSize: Int = 4, sequenceLength: Int = 1024,
         trainingDocumentCount: Int = 4, validationDocumentCount: Int = 4


        // Downloads and extracts dataset files.
        let _ = DatasetUtilities.downloadResource(
            filename: variantDetails.filename, fileExtension: variantDetails.fileExtension,
            remoteRoot: variantDetails.location, localStorageDirectory: directory, extract: true)
    }


        return rows
    }

    private static func readEncoded(in file: URL) throws -> [Int] {
        let rawText = try! String(contentsOf: file, encoding: .utf8)
        let rows = rawText.components(separatedBy: "\n")
        var tokens: Array<Int> = Array()
        for row in rows {
            guard let encoded = Int(row) else { continue }
            tokens.append(encoded)
        }
        return tokens
    }

    private static func embedding(for string: String, bpe: BytePairEncoder) -> [Int] {
        let tokens = bpe.encode(token: string, variant: .gpt2)
        // TODO(michellecasbon): Decide how to prevent OOV or choose a better ID (probably not 0).
