Skip to content

Commit

Permalink
hotfix with null ml backend and empty result type
Browse files Browse the repository at this point in the history
  • Loading branch information
nik committed Feb 7, 2020
1 parent 4743836 commit c9231b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions label_studio/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,11 @@ def _update_derived_output_schema(self, completion):
:return:
"""
for result in completion['result']:
result_type = result.get('type')
self.derived_output_schema['from_name_to_name_type'].add((
result['from_name'], result['to_name'], result['type']
result['from_name'], result['to_name'], result_type
))
for label in result['value'].get(result['type'], []):
for label in result['value'].get(result_type, []):
self.derived_output_schema['labels'][result['from_name']].add(label)

def validate_label_config_on_derived_input_schema(self, config_string_or_parsed_config):
Expand Down Expand Up @@ -270,7 +271,8 @@ def delete_tasks(self):
json.dump({}, f)

# delete everything on ML backend
self.ml_backend.clear(self)
if self.ml_backend:
self.ml_backend.clear(self)

# reload everything related to tasks
self.load_tasks()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import setuptools

# Package version
version = '0.4.6'
version = '0.4.6.post1'

# Readme
with open('README.md', 'r') as f:
Expand Down

0 comments on commit c9231b6

Please sign in to comment.