This repository was archived by the owner on Apr 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,8 @@ func readFile(_ filename: String) -> [UInt8] {
57
57
let d = Python . open ( filePath, " rb " ) . read ( )
58
58
return Array ( numpy: np. frombuffer ( d, dtype: np. uint8) ) !
59
59
}
60
- fatalError (
61
- " Failed to find file with name \( filename ) in the following folders: \( possibleFolders ) . " )
60
+ print ( " Failed to find file with name \( filename ) in the following folders: \( possibleFolders ) . " )
61
+ exit ( - 1 )
62
62
}
63
63
64
64
/// Reads MNIST images and labels from specified file paths.
Original file line number Diff line number Diff line change @@ -27,7 +27,8 @@ func readFile(_ path: String) -> [UInt8] {
27
27
let data = try ! Data ( contentsOf: filePath, options: [ ] )
28
28
return [ UInt8] ( data)
29
29
}
30
- fatalError ( " Filename not found: \( path) " )
30
+ print ( " File not found: \( path) " )
31
+ exit ( - 1 )
31
32
}
32
33
33
34
/// Reads MNIST images and labels from specified file paths.
Original file line number Diff line number Diff line change @@ -30,7 +30,10 @@ let modelConfig = ModelConfiguration(boardSize: boardSize)
30
30
var model = GoModel ( configuration: modelConfig)
31
31
32
32
guard FileManager . default. fileExists ( atPath: " ./MiniGoCheckpoint/000939-heron.data-00000-of-00001 " )
33
- else { fatalError ( " Please download the MiniGo checkpoint according to the README.md. " ) }
33
+ else {
34
+ print ( " Please download the MiniGo checkpoint according to the README.md. " )
35
+ exit ( - 1 )
36
+ }
34
37
let reader = PythonCheckpointReader ( path: " ./MiniGoCheckpoint/000939-heron " )
35
38
model. load ( from: reader)
36
39
You can’t perform that action at this time.
0 commit comments