fix test bug in srt_llava_next_test.py (#470)
This commit is contained in:
@@ -17,14 +17,14 @@ def image_qa(s, image, question):
|
|||||||
|
|
||||||
def single():
|
def single():
|
||||||
image_url = "https://farm4.staticflickr.com/3175/2653711032_804ff86d81_z.jpg"
|
image_url = "https://farm4.staticflickr.com/3175/2653711032_804ff86d81_z.jpg"
|
||||||
pil_image = load_image(image_url)
|
pil_image, _ = load_image(image_url)
|
||||||
state = image_qa.run(image=pil_image, question="What is this?", max_new_tokens=512)
|
state = image_qa.run(image=pil_image, question="What is this?", max_new_tokens=512)
|
||||||
print(state["answer"], "\n")
|
print(state["answer"], "\n")
|
||||||
|
|
||||||
|
|
||||||
def stream():
|
def stream():
|
||||||
image_url = "https://farm4.staticflickr.com/3175/2653711032_804ff86d81_z.jpg"
|
image_url = "https://farm4.staticflickr.com/3175/2653711032_804ff86d81_z.jpg"
|
||||||
pil_image = load_image(image_url)
|
pil_image, _ = load_image(image_url)
|
||||||
state = image_qa.run(
|
state = image_qa.run(
|
||||||
image=pil_image,
|
image=pil_image,
|
||||||
question="Please generate short caption for this image.",
|
question="Please generate short caption for this image.",
|
||||||
@@ -40,7 +40,7 @@ def stream():
|
|||||||
|
|
||||||
def batch():
|
def batch():
|
||||||
image_url = "https://farm4.staticflickr.com/3175/2653711032_804ff86d81_z.jpg"
|
image_url = "https://farm4.staticflickr.com/3175/2653711032_804ff86d81_z.jpg"
|
||||||
pil_image = load_image(image_url)
|
pil_image, _ = load_image(image_url)
|
||||||
states = image_qa.run_batch(
|
states = image_qa.run_batch(
|
||||||
[
|
[
|
||||||
{"image": pil_image, "question": "What is this?"},
|
{"image": pil_image, "question": "What is this?"},
|
||||||
|
|||||||
Reference in New Issue
Block a user