mirror of
https://github.com/dogkeeper886/ollama37.git
synced 2025-12-11 16:26:59 +00:00
ggml: Log filesystem errors
Sometimes loading the GGUF file fails with: panic: context canceled This is probably a filesystem error but it doesn't provide any information about what happened.
This commit is contained in:
@@ -332,6 +332,7 @@ func New(ctx context.Context, r *os.File, params ml.BackendParams) (ml.Backend,
|
|||||||
// seeking around within an FD shared between all goroutines.
|
// seeking around within an FD shared between all goroutines.
|
||||||
file, err := os.Open(r.Name())
|
file, err := os.Open(r.Name())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
slog.Warn("file open error", "file", r.Name(), "error", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
@@ -342,6 +343,7 @@ func New(ctx context.Context, r *os.File, params ml.BackendParams) (ml.Backend,
|
|||||||
for s < t.Size() {
|
for s < t.Size() {
|
||||||
n, err := io.ReadFull(sr, bts[:min(len(bts), int(t.Size()-s))])
|
n, err := io.ReadFull(sr, bts[:min(len(bts), int(t.Size()-s))])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
slog.Warn("file read error", "file", r.Name(), "error", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user