aiinference222 / test_handler.py
western92
m
176d2d4
raw
history blame
1.44 kB
""" from handler import EndpointHandler
handler = EndpointHandler(".")
result = handler(data={
"original_link": "https://i.ibb.co/w0nJvJQ/Td9sw-XMr-Rh-Xp-YPn0-B65q.png",
"prompt": "nude girl, pussy, tits"
})
print("1", result)
result = handler(data={
"original_link": "https://i.ibb.co/TM7tdCG/image-5.png",
"loras": "breastsizeslideroffset.safetensors",
"lora_weights": "1"
})
print("2", result)
"""
import concurrent.futures
from handler import EndpointHandler
handler = EndpointHandler(".")
def process_request_1():
result = handler(data={
"replicate_api_key": "r8_GTeyENFqfOXFAI0COiGlB2RkhqEzqS64XBuIk",
"original_link": "https://i.ibb.co/w0nJvJQ/Td9sw-XMr-Rh-Xp-YPn0-B65q.png",
"with_small_tits": True
})
print("1", result)
def process_request_2():
result = handler(data={
"replicate_api_key": "r8_GTeyENFqfOXFAI0COiGlB2RkhqEzqS64XBuIk",
"original_link": "https://i.ibb.co/TM7tdCG/image-5.png",
"with_big_tits": True
})
print("2", result)
def process_request_3():
result = handler(data={
"replicate_api_key": "r8_GTeyENFqfOXFAI0COiGlB2RkhqEzqS64XBuIk",
"original_link": "https://i.ibb.co/TM7tdCG/image-5.png",
})
print("3", result)
with concurrent.futures.ThreadPoolExecutor() as executor:
executor.submit(process_request_1)
executor.submit(process_request_2)
executor.submit(process_request_3)