Spaces:
Sleeping
Sleeping
Upload myinfer_latest.py
Browse files48 unmodified lines4950515252535455565758596061626348 unmodified linesconvert_voice_lock = Lock()#concurrent= os.getenv('concurrent', '')# Define the maximum number of concurrent requestsMAX_CONCURRENT_REQUESTS = os.getenv('concurrent', '5') # Adjust this number as needed
try: # Try to convert the environment variable to an integer, defaulting to 5 if not set. MAX_CONCURRENT_REQUESTS = int(os.getenv('concurrent', '5'))except ValueError: # If conversion fails, log an error or use a fallback value. print("Warning: Environment variable 'concurrent' is not a valid integer. Using default value of 5.") MAX_CONCURRENT_REQUESTS = 5
# Initialize the semaphore with the maximum number of concurrent requestsrequest_semaphore = Semaphore(MAX_CONCURRENT_REQUESTS)myinfer_latest.py+9-1