hongyiyang
commited on
Commit
•
d9d7f33
1
Parent(s):
680f9d0
minor fix
Browse files- handler.py +1 -1
handler.py
CHANGED
@@ -18,10 +18,10 @@ class EndpointHandler():
|
|
18 |
# get inputs
|
19 |
prompt = "USER: <image>\nWhat's in the image\nASSISTANT:"
|
20 |
default_url = "https://cdn.faire.com/fastly/3c335e5c06d3027964ee8351093784c94dfa264e5eb26430c803f4ab3c44da84.jpeg"
|
|
|
21 |
|
22 |
image = Image.open(requests.get(url, stream=True).raw)
|
23 |
|
24 |
-
url = data.pop("image_url", default_url)
|
25 |
|
26 |
# run normal prediction
|
27 |
outputs = self.pipeline(image, prompt=prompt, generate_kwargs={"max_new_tokens": 200})
|
|
|
18 |
# get inputs
|
19 |
prompt = "USER: <image>\nWhat's in the image\nASSISTANT:"
|
20 |
default_url = "https://cdn.faire.com/fastly/3c335e5c06d3027964ee8351093784c94dfa264e5eb26430c803f4ab3c44da84.jpeg"
|
21 |
+
url = data.pop("image_url", default_url)
|
22 |
|
23 |
image = Image.open(requests.get(url, stream=True).raw)
|
24 |
|
|
|
25 |
|
26 |
# run normal prediction
|
27 |
outputs = self.pipeline(image, prompt=prompt, generate_kwargs={"max_new_tokens": 200})
|