fix inputs
Browse files- handler.py +2 -2
- test_inference_endpoint.py +2 -4
handler.py
CHANGED
|
@@ -34,8 +34,8 @@ class EndpointHandler:
|
|
| 34 |
# get inputs
|
| 35 |
inputs = data.pop("inputs", data)
|
| 36 |
# get additional date field0
|
| 37 |
-
prompt = inputs.pop("prompt", None)
|
| 38 |
-
image_url = inputs.pop("
|
| 39 |
|
| 40 |
print(image_url)
|
| 41 |
print(prompt)
|
|
|
|
| 34 |
# get inputs
|
| 35 |
inputs = data.pop("inputs", data)
|
| 36 |
# get additional date field0
|
| 37 |
+
prompt = inputs.pop("prompt", None)
|
| 38 |
+
image_url = inputs.pop("image", None)
|
| 39 |
|
| 40 |
print(image_url)
|
| 41 |
print(prompt)
|
test_inference_endpoint.py
CHANGED
|
@@ -12,9 +12,7 @@ headers = {"Authorization": f"Bearer {TOKEN}"}
|
|
| 12 |
|
| 13 |
# prepare sample payload
|
| 14 |
prompt = "Can you describe this picture focusing on specifics visual artifacts and ambiance (objects, colors, person, athmosphere..). Please stay concise only output keywords and concepts detected."
|
| 15 |
-
|
| 16 |
-
{"path": "https://media.rolex.com/image/upload/q_auto/f_auto/c_limit,w_2440/v1708384234/rolexcom/about-rolex/hub/about-rolex-hub-cover-aca202310cw-0002-portrait"}
|
| 17 |
-
]
|
| 18 |
|
| 19 |
def call(payload):
|
| 20 |
response = requests.post(
|
|
@@ -35,7 +33,7 @@ def test_local(payload):
|
|
| 35 |
payload = {
|
| 36 |
"inputs": {
|
| 37 |
"prompt": prompt,
|
| 38 |
-
"
|
| 39 |
}
|
| 40 |
}
|
| 41 |
|
|
|
|
| 12 |
|
| 13 |
# prepare sample payload
|
| 14 |
prompt = "Can you describe this picture focusing on specifics visual artifacts and ambiance (objects, colors, person, athmosphere..). Please stay concise only output keywords and concepts detected."
|
| 15 |
+
image = "https://media.rolex.com/image/upload/q_auto/f_auto/c_limit,w_2440/v1708384234/rolexcom/about-rolex/hub/about-rolex-hub-cover-aca202310cw-0002-portrait"
|
|
|
|
|
|
|
| 16 |
|
| 17 |
def call(payload):
|
| 18 |
response = requests.post(
|
|
|
|
| 33 |
payload = {
|
| 34 |
"inputs": {
|
| 35 |
"prompt": prompt,
|
| 36 |
+
"image": image
|
| 37 |
}
|
| 38 |
}
|
| 39 |
|