HumanSignal / HumanSignal/label-studio-ml-backend
ner-model: fit() crashes with TypeError: string indices must be integers
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 490
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 3
Description
labelstudio: 1.8.1
label-studio-ml: 1.0.9
```
[2023-08-19 11:46:24,325] [DEBUG] [urllib3.connectionpool::_new_conn::1014] Starting new HTTPS connection (1): huggingface.co:443
[2023-08-19 11:46:24,675] [DEBUG] [urllib3.connectionpool::_make_request::473] https://huggingface.co:443 "HEAD /bert-base-uncased/resolve/main/tokenizer_config.json HTTP/1.1" 200 0
[2023-08-19 11:46:24,727] [DEBUG] [ner::fit::487] Read data
[2023-08-19 11:46:46,433] [ERROR] [label_studio_ml.exceptions::exception_f::53] Traceback (most recent call last):
File "/home/d3vopz/.local/lib/python3.9/site-packages/label_studio_ml/exceptions.py", line 39, in exception_f
return f(*args, **kwargs)
File "/home/d3vopz/.local/lib/python3.9/site-packages/label_studio_ml/api.py", line 93, in _train
job = _manager.train(annotations, project, label_config, **params)
File "/home/d3vopz/.local/lib/python3.9/site-packages/label_studio_ml/model.py", line 711, in train
job_result = cls.train_script_wrapper(
File "/home/d3vopz/.local/lib/python3.9/site-packages/label_studio_ml/model.py", line 667, in train_script_wrapper
train_output = m.model.fit(data_stream, workdir, **train_kwargs)
File "/home/d3vopz/my-ml-model/ner-20230819125600/ner.py", line 490, in fit
completions = self._get_annotated_dataset(data['project_id'])
TypeError: string indices must be integers
```
RCA:
` completions = self._get_annotated_dataset(data['project_id'])`: data is a simple string as param `workdir` overhanded in
`train_output = m.model.fit(data_stream, workdir, **train_kwargs)` which does not make IMHO not sense because workdir is in fit() retrieved via
`workdir = os.getenv('WORK_DIR')`
ANYHOW: if the exception will be fixed the next one will be raised in
```
def _get_annotated_dataset(self, project_id):
raise NotImplementedError('For this model, you need to implement data ingestion pipeline: '
'go to ner.py > _get_annotated_dataset() and put your logic to retrieve'
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.