mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 18:36:41 +02:00
Revert "adjust download and upload concurrency based on available bandwidth" (#2995)
This commit is contained in:
parent
2ada81e068
commit
fc06205971
2 changed files with 17 additions and 106 deletions
|
@ -18,6 +18,7 @@ import (
|
|||
|
||||
"github.com/jmorganca/ollama/api"
|
||||
"github.com/jmorganca/ollama/format"
|
||||
"golang.org/x/sync/errgroup"
|
||||
)
|
||||
|
||||
var blobUploadManager sync.Map
|
||||
|
@ -136,17 +137,14 @@ func (b *blobUpload) Run(ctx context.Context, opts *registryOptions) {
|
|||
}
|
||||
defer b.file.Close()
|
||||
|
||||
var limit int64 = 2
|
||||
g, inner := NewLimitGroup(ctx, numUploadParts, limit)
|
||||
go watchDelta(inner, g, &b.Completed, limit)
|
||||
|
||||
g, inner := errgroup.WithContext(ctx)
|
||||
g.SetLimit(numUploadParts)
|
||||
for i := range b.Parts {
|
||||
part := &b.Parts[i]
|
||||
select {
|
||||
case <-inner.Done():
|
||||
break
|
||||
case requestURL := <-b.nextURL:
|
||||
g.Go(inner, func() error {
|
||||
g.Go(func() error {
|
||||
var err error
|
||||
for try := 0; try < maxRetries; try++ {
|
||||
err = b.uploadPart(inner, http.MethodPatch, requestURL, part, opts)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue