HumanSignal / label-studio-sdk

Label Studio SDK
https://api.labelstud.io
Apache License 2.0
99 stars 61 forks source link

Timeout error at 10sec when importing task with large image #183

Open fares-ipgp opened 8 months ago

fares-ipgp commented 8 months ago

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).

ww-insight commented 6 months ago

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