Commit ·
0367fad
1
Parent(s): 39f2169
changed port
Browse files
test.py
CHANGED
|
@@ -3,14 +3,13 @@ import time
|
|
| 3 |
import random
|
| 4 |
import requests
|
| 5 |
import logging
|
| 6 |
-
from typing import Union, Tuple
|
| 7 |
from concurrent.futures import ThreadPoolExecutor, as_completed
|
| 8 |
from tqdm import tqdm # optional: install via `pip install tqdm`
|
| 9 |
|
| 10 |
# ----------------------------- #
|
| 11 |
# Configuration #
|
| 12 |
# ----------------------------- #
|
| 13 |
-
URL = "http://localhost:
|
| 14 |
NUM_REQUESTS = 4000
|
| 15 |
MAX_WORKERS = os.cpu_count()
|
| 16 |
TIMEOUT = 20
|
|
@@ -46,7 +45,7 @@ def build_payload() -> dict:
|
|
| 46 |
# ----------------------------- #
|
| 47 |
# Request Sender Logic #
|
| 48 |
# ----------------------------- #
|
| 49 |
-
def send_request() ->
|
| 50 |
try:
|
| 51 |
response = requests.post(
|
| 52 |
URL,
|
|
|
|
| 3 |
import random
|
| 4 |
import requests
|
| 5 |
import logging
|
|
|
|
| 6 |
from concurrent.futures import ThreadPoolExecutor, as_completed
|
| 7 |
from tqdm import tqdm # optional: install via `pip install tqdm`
|
| 8 |
|
| 9 |
# ----------------------------- #
|
| 10 |
# Configuration #
|
| 11 |
# ----------------------------- #
|
| 12 |
+
URL = "http://localhost:7860/classify"
|
| 13 |
NUM_REQUESTS = 4000
|
| 14 |
MAX_WORKERS = os.cpu_count()
|
| 15 |
TIMEOUT = 20
|
|
|
|
| 45 |
# ----------------------------- #
|
| 46 |
# Request Sender Logic #
|
| 47 |
# ----------------------------- #
|
| 48 |
+
def send_request() -> int | str:
|
| 49 |
try:
|
| 50 |
response = requests.post(
|
| 51 |
URL,
|