Skip to content

Commit

Permalink
com.rest.huggingface 1.0.0-preview.10 (#8)
Browse files Browse the repository at this point in the history
- fixed model loading retry attempt timing
  • Loading branch information
StephenHodgson authored Aug 17, 2023
1 parent 8f0bc4e commit 35a45a2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Runtime/Inference/InferenceEndpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ async Task<Response> CallEndpointAsync()
if (restEx.Response.Code == 503 &&
task.Options.WaitForModel)
{
if (EnableLogging)
{
Debug.LogWarning($"Waiting for model, attempt {attempt} of {MaxRetryAttempts}\n{restEx}");
}

if (++attempt == MaxRetryAttempts)
{
throw;
Expand All @@ -94,7 +89,12 @@ async Task<Response> CallEndpointAsync()
throw restEx;
}

await Task.Delay(TimeSpan.FromSeconds(error.EstimatedTime), cancellationToken);
if (EnableLogging)
{
Debug.LogWarning($"Waiting for model for {error.EstimatedTime} seconds... attempt {attempt} of {MaxRetryAttempts}\n{restEx}");
}

await Task.Delay(TimeSpan.FromSeconds(error.EstimatedTime), cancellationToken).ConfigureAwait(true);
response = await CallEndpointAsync();
}
else
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "HuggingFace",
"description": "A Non-Official HuggingFace Rest Client for Unity (UPM)",
"keywords": [],
"version": "1.0.0-preview.9",
"version": "1.0.0-preview.10",
"unity": "2021.3",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.rest.huggingface#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.rest.huggingface/releases",
Expand All @@ -20,7 +20,7 @@
"registry": "https://package.openupm.com"
},
"dependencies": {
"com.utilities.rest": "2.1.3",
"com.utilities.rest": "2.1.6",
"com.utilities.encoder.wav": "1.0.4"
},
"hideInEditor": false
Expand Down

0 comments on commit 35a45a2

Please sign in to comment.