Update main.py
Browse files194 unmodified lines19519619719819920020120220320463 unmodified lines268269270271272273274275194 unmodified lines# semaphore = asyncio.Semaphore(1)async def send_video_for_transcription(file: UploadFile, hash_path: str):# async with semaphore:try:logger.info(f"Background task: sending video {file.filename} for transcription")run_time = api.get_space_runtime(repo_id=repo_id)63 unmodified lines# else:# logger.error(f"Error sending video for transcription: {response.text}")background_tasks.add_task(send_video_for_transcription, file, hash_path)return JSONResponse(content={"status": "success", "message": "Video received. Processing will start soon."}, status_code=200)194 unmodified lines19519619719819920020120220320463 unmodified lines268269270271272273274275276194 unmodified linessemaphore = asyncio.Semaphore(1)async def send_video_for_transcription(file: UploadFile, hash_path: str):async with semaphore:try:logger.info(f"Background task: sending video {file.filename} for transcription")run_time = api.get_space_runtime(repo_id=repo_id)63 unmodified lines# else:# logger.error(f"Error sending video for transcription: {response.text}")file_content = await file.read()background_tasks.add_task(send_video_for_transcription, file_content, hash_path)return JSONResponse(content={"status": "success", "message": "Video received. Processing will start soon."}, status_code=200)
main.py+4-3