[GH-ISSUE #83] TypeError: Object of type BlipTextConfig is not JSON serializable #74

Open
opened 2026-10-31 21:16:36 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @MrSumNemo on GitHub (Apr 6, 2024).
Original GitHub issue: https://github.com/pharmapsychotic/clip-interrogator-ext/issues/83

Hello,
I tried this extension on A1111 but it sends me the error " TypeError: Object of type BlipTextConfig is not JSON serializable " everytime. Everything else seems to work so I have no idea what it can mean.

Here is the complete log for the tab :

Starting job (unknown)
Loading CLIP Interrogator 0.6.0...
Loading caption model blip-base...
Traceback (most recent call last):
File "D:\A1111\system\python\lib\site-packages\gradio\routes.py", line 488, in run_predict
output = await app.get_blocks().process_api(
File "D:\A1111\system\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api
result = await self.call_function(
File "D:\A1111\system\python\lib\site-packages\gradio\blocks.py", line 1103, in call_function
prediction = await anyio.to_thread.run_sync(
File "D:\A1111\system\python\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
return await get_asynclib().run_sync_in_worker_thread(
File "D:\A1111\system\python\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread
return await future
File "D:\A1111\system\python\lib\site-packages\anyio_backends_asyncio.py", line 807, in run
result = context.run(func, *args)
File "D:\A1111\system\python\lib\site-packages\gradio\utils.py", line 707, in wrapper
response = f(*args, **kwargs)
File "D:\A1111\webui\extensions\clip-interrogator-ext\scripts\clip_interrogator_ext.py", line 131, in image_to_prompt
load(clip_model_name)
File "D:\A1111\webui\extensions\clip-interrogator-ext\scripts\clip_interrogator_ext.py", line 71, in load
ci = Interrogator(config)
File "D:\A1111\system\python\lib\site-packages\clip_interrogator\clip_interrogator.py", line 70, in init
self.load_caption_model()
File "D:\A1111\system\python\lib\site-packages\clip_interrogator\clip_interrogator.py", line 84, in load_caption_model
caption_model = BlipForConditionalGeneration.from_pretrained(model_path, torch_dtype=self.dtype)
File "D:\A1111\system\python\lib\site-packages\transformers\modeling_utils.py", line 2305, in from_pretrained
files_timestamps = self.get_files_timestamps(save_directory)
File "D:\A1111\system\python\lib\site-packages\transformers\configuration_utils.py", line 554, in from_pretrained
To test a pull request you made on the Hub, you can pass `revision="refs/pr/<pr_number>".
File "D:\A1111\system\python\lib\site-packages\transformers\configuration_utils.py", line 725, in from_dict
else:
File "D:\A1111\system\python\lib\site-packages\transformers\configuration_utils.py", line 757, in repr
File "D:\A1111\system\python\lib\site-packages\transformers\configuration_utils.py", line 843, in to_json_string
if (
File "json_init
.py", line 238, in dumps
File "json\encoder.py", line 201, in encode
File "json\encoder.py", line 431, in _iterencode
File "json\encoder.py", line 405, in _iterencode_dict
File "json\encoder.py", line 438, in _iterencode
File "json\encoder.py", line 179, in default
TypeError: Object of type BlipTextConfig is not JSON serializable

Originally created by @MrSumNemo on GitHub (Apr 6, 2024). Original GitHub issue: https://github.com/pharmapsychotic/clip-interrogator-ext/issues/83 Hello, I tried this extension on A1111 but it sends me the error " TypeError: Object of type BlipTextConfig is not JSON serializable " everytime. Everything else seems to work so I have no idea what it can mean. Here is the complete log for the tab : Starting job (unknown) Loading CLIP Interrogator 0.6.0... Loading caption model blip-base... Traceback (most recent call last): File "D:\A1111\system\python\lib\site-packages\gradio\routes.py", line 488, in run_predict output = await app.get_blocks().process_api( File "D:\A1111\system\python\lib\site-packages\gradio\blocks.py", line 1431, in process_api result = await self.call_function( File "D:\A1111\system\python\lib\site-packages\gradio\blocks.py", line 1103, in call_function prediction = await anyio.to_thread.run_sync( File "D:\A1111\system\python\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "D:\A1111\system\python\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "D:\A1111\system\python\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run result = context.run(func, *args) File "D:\A1111\system\python\lib\site-packages\gradio\utils.py", line 707, in wrapper response = f(*args, **kwargs) File "D:\A1111\webui\extensions\clip-interrogator-ext\scripts\clip_interrogator_ext.py", line 131, in image_to_prompt load(clip_model_name) File "D:\A1111\webui\extensions\clip-interrogator-ext\scripts\clip_interrogator_ext.py", line 71, in load ci = Interrogator(config) File "D:\A1111\system\python\lib\site-packages\clip_interrogator\clip_interrogator.py", line 70, in __init__ self.load_caption_model() File "D:\A1111\system\python\lib\site-packages\clip_interrogator\clip_interrogator.py", line 84, in load_caption_model caption_model = BlipForConditionalGeneration.from_pretrained(model_path, torch_dtype=self.dtype) File "D:\A1111\system\python\lib\site-packages\transformers\modeling_utils.py", line 2305, in from_pretrained files_timestamps = self._get_files_timestamps(save_directory) File "D:\A1111\system\python\lib\site-packages\transformers\configuration_utils.py", line 554, in from_pretrained To test a pull request you made on the Hub, you can pass `revision="refs/pr/<pr_number>". File "D:\A1111\system\python\lib\site-packages\transformers\configuration_utils.py", line 725, in from_dict else: File "D:\A1111\system\python\lib\site-packages\transformers\configuration_utils.py", line 757, in __repr__ File "D:\A1111\system\python\lib\site-packages\transformers\configuration_utils.py", line 843, in to_json_string if ( File "json\__init__.py", line 238, in dumps File "json\encoder.py", line 201, in encode File "json\encoder.py", line 431, in _iterencode File "json\encoder.py", line 405, in _iterencode_dict File "json\encoder.py", line 438, in _iterencode File "json\encoder.py", line 179, in default TypeError: Object of type BlipTextConfig is not JSON serializable
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pharmapsychotic/clip-interrogator-ext#74
No description provided.