@@ -20,18 +20,19 @@ def create_server():
2020
2121
2222@pytest .mark .parametrize (
23- "image_url, success, re_content" ,
23+ "prompt, image_url, success, re_content" ,
2424 [
2525 # test model is trained on CIFAR-10, but it's quite dumb due to small size
26- (IMG_URL_0 , True , "(cat)+" ),
27- ("IMG_BASE64_0" , True , "(cat)+" ), # exceptional, so that we don't cog up the log
28- (IMG_URL_1 , True , "(frog)+" ),
29- ("malformed" , False , None ),
30- ("https://google.com/404" , False , None ), # non-existent image
31- ("https://ggml.ai" , False , None ), # non-image data
26+ ("What is this:\n " , IMG_URL_0 , True , "(cat)+" ),
27+ ("What is this:\n " , "IMG_BASE64_0" , True , "(cat)+" ), # exceptional, so that we don't cog up the log
28+ ("What is this:\n " , IMG_URL_1 , True , "(frog)+" ),
29+ ("Test test\n " , IMG_URL_1 , True , "(frog)+" ), # test invalidate cache
30+ ("What is this:\n " , "malformed" , False , None ),
31+ ("What is this:\n " , "https://google.com/404" , False , None ), # non-existent image
32+ ("What is this:\n " , "https://ggml.ai" , False , None ), # non-image data
3233 ]
3334)
34- def test_vision_chat_completion (image_url , success , re_content ):
35+ def test_vision_chat_completion (prompt , image_url , success , re_content ):
3536 global server
3637 server .start (timeout_seconds = 60 ) # vision model may take longer to load due to download size
3738 if image_url == "IMG_BASE64_0" :
@@ -41,7 +42,7 @@ def test_vision_chat_completion(image_url, success, re_content):
4142 "top_k" : 1 ,
4243 "messages" : [
4344 {"role" : "user" , "content" : [
44- {"type" : "text" , "text" : "What is this: \n " },
45+ {"type" : "text" , "text" : prompt },
4546 {"type" : "image_url" , "image_url" : {
4647 "url" : image_url ,
4748 }},
0 commit comments