File tree Expand file tree Collapse file tree 2 files changed +19
-6
lines changed
charts/azimuth-llm/templates/test Expand file tree Collapse file tree 2 files changed +19
-6
lines changed Original file line number Diff line number Diff line change 24
24
- http://{{ .Values.ui.service.name }}.{{ .Release.Namespace }}.svc
25
25
{{- end }}
26
26
restartPolicy : Never
27
- # Allow plenty of retries since downloading
28
- # model weights can take a long time.
29
- backoffLimit : 20
27
+ # Handle retries within gradio-test-client script
28
+ backoffLimit : 1
30
29
{{- end -}}
Original file line number Diff line number Diff line change 1
1
import sys
2
+ import time
3
+
2
4
from gradio_client import Client
3
5
4
6
gradio_host = sys .argv [1 ]
5
- client = Client (gradio_host )
6
- result = client .predict ("Hi" , api_name = "/chat" )
7
- print (result )
7
+
8
+ retries = 60
9
+ for n in range (1 , retries + 1 ):
10
+ try :
11
+ client = Client (gradio_host )
12
+ result = client .predict ("Hi" , api_name = "/chat" )
13
+ print (result )
14
+ break
15
+ except Exception as err :
16
+ msg = f"Attempt { n } / { retries } encounter error: { err } "
17
+ if n < retries :
18
+ print (msg , "- waiting 10 seconds before retrying" )
19
+ time .sleep (10 )
20
+ else :
21
+ print (msg , "- no more retries left" )
You can’t perform that action at this time.
0 commit comments