Skip to content

add method for exporting predictions#300

Merged
sasha-scale merged 6 commits intomasterfrom
sasha/prediction_export
May 19, 2022
Merged

add method for exporting predictions#300
sasha-scale merged 6 commits intomasterfrom
sasha/prediction_export

Conversation

@sasha-scale
Copy link
Contributor

No description provided.

Copy link
Contributor

@jean-lucas jean-lucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, could you also update the version + changelog?

Returns:
Response payload as JSON dict.
"""
print(payload, route)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏 finally haha i was looking for this

nucleus/slice.py Outdated
route=f"slice/{self.id}/{model.id}/exportForTraining",
requests_command=requests.get,
)
print(api_payload)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
print(api_payload)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😆

nucleus/utils.py Outdated


def convert_export_payload(api_payload):
def convert_export_payload(api_payload, model_id: str = None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would make more sense to pass a boolean instead of nullable string here. Since we're not using the
value of model_id anywhere.

ie: convert_export_payload(api_payload, has_predictions: bool = False):

nucleus/slice.py Outdated
)
return convert_export_payload(api_payload[EXPORTED_ROWS])

def items_and_predictions(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I think it would be easier to use if we had the same interface for exporting items, predictions and annotations between a slice and a dataset. Right now the corresponding method in a dataset is export_predictions(model). I'd make this method consistent with the dataset one.

Just wondering in case we have a huge export, wouldn't we also run into timeout issues then with this request?

@sasha-scale sasha-scale requested review from jean-lucas and pfmark May 19, 2022 14:34
Copy link
Contributor

@jean-lucas jean-lucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for addressing the comments. LGTM once conflicts are resolved 👍

@sasha-scale sasha-scale merged commit 91b8743 into master May 19, 2022
@sasha-scale sasha-scale deleted the sasha/prediction_export branch May 19, 2022 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants