Skip to content
This repository was archived by the owner on Apr 23, 2025. It is now read-only.

Style fixes from #154 #155

Merged
merged 1 commit into from
May 9, 2019
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
2 changes: 1 addition & 1 deletion Transformer/PythonCheckpointReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import TensorFlow

struct Config : Codable {
struct Config: Codable {
let vocabSize: Int
let contextSize: Int
let embeddingSize: Int
Expand Down
2 changes: 1 addition & 1 deletion Transformer/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let encoder = Python.import("encoder").get_encoder(modelName)

let checkpoint = "models/\(modelName)/model.ckpt"
let configFile = "models/\(modelName)/hparams.json"
let configData = try Data.init(contentsOf: URL(fileURLWithPath: configFile))
let configData = try Data(contentsOf: URL(fileURLWithPath: configFile))
let config = try JSONDecoder().decode(Config.self, from: configData)
let model = TransformerLM(
contentsOfPythonCheckpointFile: checkpoint, config: config, scope: "model")
Expand Down