File tree Expand file tree Collapse file tree 2 files changed +26
-4
lines changed
charts/azimuth-llm/templates/test Expand file tree Collapse file tree 2 files changed +26
-4
lines changed Original file line number Diff line number Diff line change 1010 spec :
1111 containers :
1212 - name : gradio-client-test
13- {{- /*
14- Use the chat image since we know this contains the gradio_client package
15- */}}
16- image : {{ printf "ghcr.io/stackhpc/azimuth-llm-chat-ui:%s" (default .Chart.AppVersion .Values.ui.image.tag) }}
13+ image : {{ printf "%s:%s" .Values.ui.image.repository (default .Chart.AppVersion .Values.ui.image.tag) }}
1714 imagePullPolicy : IfNotPresent
1815 command :
1916 - python
Original file line number Diff line number Diff line change 1+ import sys
2+ import time
3+
4+ from gradio_client import Client
5+
6+ gradio_host = sys .argv [1 ]
7+
8+ retries = 60
9+ for n in range (1 , retries + 1 ):
10+ try :
11+ client = Client (gradio_host )
12+ result = client .predict (
13+ image_url = "https://miro.medium.com/v2/resize:fit:1100/format:webp/1*xDgN0L2RfkS8Kc7uTwsRqw.jpeg" ,
14+ prompt = "Hi" ,
15+ api_name = "/predict"
16+ )
17+ print (result )
18+ break
19+ except Exception as err :
20+ msg = f"Attempt { n } / { retries } encounter error: { err } "
21+ if n < retries :
22+ print (msg , "- waiting 10 seconds before retrying" )
23+ time .sleep (10 )
24+ else :
25+ print (msg , "- no more retries left" )
You can’t perform that action at this time.
0 commit comments