chore: remove marian's duplicate installation check
marian.Installed and marian.Files were only used by the package's own test, while the app has its own check in translation.go - with a different rule (pinned size there, size > 0 here), so the two definitions of 'installed' could disagree. The app's check is the canonical one (it owns the pins); Load already fails on an incomplete model, which the test keeps asserting.
This commit is contained in:
1 parent
1440adc199
commit
e85d0ba7e9
3 files changed
-19
No files matched your search
@@ -21,16 +21,6 @@ type RemoteFile struct {
|
||||
SHA256 string
|
||||
}
|
||||
|
||||
// Installed reports whether dir holds every file of a model.
|
||||
func Installed(dir string) bool {
|
||||
for _, f := range Files {
|
||||
if st, err := os.Stat(filepath.Join(dir, f)); err != nil || st.Size() == 0 {
|
||||
return false
|
||||
}
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// Download fetches files into dir. A file already there with the right
|
||||
// size and digest is skipped. A file is downloaded into a ".partial" file
|
||||
// that is renamed only once its digest checks out, so an interrupted
|
||||
|
||||
Reference in new issue
Block a user