Amitai Getzler
:heavy_plus_sign: Add
6d8b6f3
from handler import EndpointHandler
# init handler
my_handler = EndpointHandler()
# prepare sample payload
embedding_input = {
"inputs": {
"batch": [
{
"image": "https://lp2.hm.com/hmgoepprod?set=source[/23/ab/23ab27480dd2dfc7007745402d3b8caaf756ee70.jpg],origin[dam],category[],type[DESCRIPTIVESTILLLIFE],res[m],hmver[2]&call=url[file:/product/style]",
"description": "test",
}
]
},
"type": "embedd",
}
classify_input = {
"inputs": {
"candidates": [
"Bohemian",
"Vintage",
"Streetwear",
"Preppy",
"Minimalist",
"Glamorous",
"Punk",
"Romantic",
"Classic",
"Avant-garde",
"Grunge",
"Retro",
"Gothic",
"Hippie",
"Eco-friendly",
],
"image": "https://static.zara.net/assets/public/bb1f/0983/a29f44e18ec9/3b7dd5791c67/05575420427-e1/05575420427-e1.jpg?ts=1708614949903&w=1126",
},
"type": "classify",
}
# test the handler
embedd_pred = my_handler(embedding_input)
classify_pred = my_handler(classify_input)
# show results
print("embedd_pred", embedd_pred)
print("classify_pred", classify_pred)