Skip to content

Commit

Permalink
[shortfin] Add port specifier to send_request.py
Browse files Browse the repository at this point in the history
  • Loading branch information
AWoloszyn committed Nov 13, 2024
1 parent 7bd3253 commit 3e12bbc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion shortfin/python/shortfin_apps/sd/examples/send_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def send_json_file(args):
)
# Send the data to the /generate endpoint
try:
response = requests.post("http://0.0.0.0:8000/generate", json=data)
response = requests.post(f"http://0.0.0.0:{args.port}/generate", json=data)
response.raise_for_status() # Raise an error for bad responses
timestamp = dt.now().strftime("%Y-%m-%d_%H-%M-%S")
request = json.loads(response.request.body.decode("utf-8"))
Expand Down Expand Up @@ -86,5 +86,6 @@ def get_batched(request, arg, idx):
p.add_argument("--file", type=str, default="default")
p.add_argument("--reps", type=int, default=1)
p.add_argument("--save", type=argparse.BooleanOptionalAction, help="save images")
p.add_argument("--port", type=int, default=8000)
args = p.parse_args()
send_json_file(args)

0 comments on commit 3e12bbc

Please sign in to comment.