Closed sayondeep closed 5 months ago
full error log:
JSONDecodeError Traceback (most recent call last)
7 frames /usr/local/lib/python3.10/dist-packages/transcribe_anything/api.py in transcribe(url_or_file, output_dir, model, task, language, device, embed, hugging_face_token, other_args) 202 with tempfile.TemporaryDirectory() as tmpdir: 203 if device_enum == Device.INSANE: --> 204 run_insanely_fast_whisper( 205 input_wav=Path(tmp_wav), 206 model=model_str,
/usr/local/lib/python3.10/dist-packages/transcribe_anything/insanely_fast_whisper.py in run_insanely_fast_whisper(input_wav, model, output_dir, task, language, hugging_face_token, other_args) 196 """Runs insanely fast whisper.""" 197 env = get_environment() --> 198 device_id = get_device_id() 199 cmd_list = [] 200 output_dir.mkdir(parents=True, exist_ok=True)
/usr/local/lib/python3.10/dist-packages/transcribe_anything/insanely_fast_whisper.py in get_device_id() 88 if sys.platform == "darwin": 89 return "mps" ---> 90 cuda_info = get_cuda_info() 91 if not cuda_info.cuda_available: 92 raise ValueError("CUDA is not available.")
/usr/local/lib/python3.10/dist-packages/transcribe_anything/insanely_fast_whisper.py in get_cuda_info() 79 ) 80 stdout = cp.stdout ---> 81 CUDA_INFO = CudaInfo.from_json_str(stdout) 82 return CUDA_INFO 83
/usr/local/lib/python3.10/dist-packages/transcribe_anything/cuda_available.py in from_json_str(json_str) 64 def from_json_str(json_str: str) -> "CudaInfo": 65 """Loads from json str and returns a CudaInfo object.""" ---> 66 data = json.loads(json_str) 67 cuda_devices_data = data.get("cuda_devices", []) 68 cuda_devices = [CudaDevice(**device) for device in cuda_devices_data]
/usr/lib/python3.10/json/init.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 344 parse_int is None and parse_float is None and 345 parse_constant is None and object_pairs_hook is None and not kw): --> 346 return _default_decoder.decode(s) 347 if cls is None: 348 cls = JSONDecoder
/usr/lib/python3.10/json/decoder.py in decode(self, s, _w) 335 336 """ --> 337 obj, end = self.raw_decode(s, idx=_w(s, 0).end()) 338 end = _w(s, end).end() 339 if end != len(s):
/usr/lib/python3.10/json/decoder.py in raw_decode(self, s, idx) 353 obj, end = self.scan_once(s, idx) 354 except StopIteration as err: --> 355 raise JSONDecodeError("Expecting value", s, err.value) from None 356 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Thanks for this, I'll look into this now
Can you make a public collab for me to test? I can't reproduce the error (yet). It looks like the subprocess to get the cuda information is not returning the expected string, but instead returning None, which causes the json parser to barf.
Also, I see that in your isolated-environment it is loading srtranslator. This indicates you are running an older transcribe-anything version, as the newer versions move this out to it's own dependency. Can you try upgrading using pip install -U transcribe-anything
Never mind, I was able to reproduce it on linux. It's an error with isolated environment. I'll try and fix.
Okay, fix has been issued. Please upgrade transcribe-anything
via pip install -U transcribe-anything
On using the api I am getting the following error: /usr/lib/python3.10/json/decoder.py in raw_decode(self, s, idx) 353 obj, end = self.scan_once(s, idx) 354 except StopIteration as err: --> 355 raise JSONDecodeError("Expecting value", s, err.value) from None 356 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0)