mirror of
https://github.com/modelscope/modelscope.git
synced 2025-12-16 16:27:45 +01:00
Fix json.decoder.JSONDecodeError when load pipeline_schema.json (#859)
When we use `modelscope server` to serve the model, the comma after last json object in this file will cause the error bellow:
```log
ERROR: Traceback (most recent call last):
File "/opt/conda/lib/python3.10/site-packages/starlette/routing.py", line 732, in lifespan
async with self.lifespan_context(app) as maybe_state:
File "/opt/conda/lib/python3.10/site-packages/starlette/routing.py", line 608, in __aenter__
await self._router.startup()
File "/opt/conda/lib/python3.10/site-packages/starlette/routing.py", line 711, in startup
handler()
File "/opt/conda/lib/python3.10/site-packages/modelscope/server/core/event_handlers.py", line 37, in startup
_startup_model(app)
File "/opt/conda/lib/python3.10/site-packages/modelscope/server/core/event_handlers.py", line 22, in _startup_model
info['schema'] = get_task_schemas(app.state.pipeline.group_key)
File "/opt/conda/lib/python3.10/site-packages/modelscope/utils/input_output.py", line 837, in get_task_schemas
schema = json.load(f)
File "/opt/conda/lib/python3.10/json/__init__.py", line 293, in load
return loads(fp.read(),
File "/opt/conda/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/opt/conda/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/opt/conda/lib/python3.10/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 3836 column 1 (char 100720)
```
This commit is contained in:
@@ -3832,5 +3832,5 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user