Skip to content

Commit 3e8c8de

Browse files
committed
Add separate VLM end to end test
1 parent 3724392 commit 3e8c8de

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

charts/azimuth-llm/templates/test/end-to-end.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ spec:
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
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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")

0 commit comments

Comments
 (0)