Skip to content

How to setup parameter for batch endpoint #546

Discussion options

You must be logged in to vote

I think the correct way should be.

import requests
single_input = {"input": {"age": age, "json_example": json_example_4_subject}}
batch_input = {"inputs": [{"age": age, "json_example": json_example_4_subject},{"age": age2, "json_example": json_example_5_subject}]}


response_single = requests.post("http://localhost:8000/generate_subjects/invoke", json=single_input)
response_batch = requests.post("http://localhost:8000/generate_subjects/batch", json=batch_input)

print(response_single.json())
print(response_batch.json())

the batch endpoint expects an object with a key "inputs" that has as a value a list of objects with the type the invoke endpoint expects.

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by eyurtsev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #544 on March 20, 2024 16:36.