label-studio-sdk icon indicating copy to clipboard operation
label-studio-sdk copied to clipboard

Timeout error at 10sec when importing task with large image

Open fares-ipgp opened this issue 2 years ago • 1 comments

When importing a task with project.import_task('path_to_image'), there is a timeout of 10 seconds and large images (20Mb) cant upload. When using WebUI it works ok.

After modifying the timeout in the import_tasks function fom (10,600) to (100,600) it worked ok...

            # try import from file
            if not os.path.isfile(tasks):
                raise LabelStudioException(f'Not found import tasks file {tasks}')
            with open(tasks, mode='rb') as f:
                response = self.make_request(
                    method='POST',
                    url=f'/api/projects/{self.id}/import',
                    files={'file': f},
                    params=params,
                    timeout=(100, 600), ## ORIGINAL: timeout=(10, 600),
                )

I am confused because I would expect to have a 600s timeout for the upload but the limit is given by the first number (10 in the original code).

fares-ipgp avatar Feb 21 '24 15:02 fares-ipgp

Same problem. Would be nice to pass timeout as an optional argument

ww-insight avatar Apr 24 '24 15:04 ww-insight