File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -336,10 +336,9 @@ def create_model(
336
336
)
337
337
model ["scoreCodeType" ] = score_code_type or model .get ("scoreCodeType" )
338
338
model ["trainTable" ] = training_table or model .get ("trainTable" )
339
- model [
340
- "classificationEventProbabilityVariableName"
341
- ] = event_prob_variable or model .get (
342
- "classificationEventProbabilityVariableName"
339
+ model ["classificationEventProbabilityVariableName" ] = (
340
+ event_prob_variable
341
+ or model .get ("classificationEventProbabilityVariableName" )
343
342
)
344
343
model ["classificationTargetEventValue" ] = event_target_value or model .get (
345
344
"classificationTargetEventValue"
@@ -412,13 +411,15 @@ def add_model_content(
412
411
return cls .post (
413
412
"/models/{}/contents" .format (id_ ), files = files , params = params
414
413
)
415
- # Delete the older duplicate model and rerun the API call
414
+ # Deletes the duplicate content and reruns the API call
416
415
except HTTPError as e :
417
416
if e .code == 409 :
418
417
model_contents = cls .get_model_contents (id_ )
419
418
for item in model_contents :
420
419
if item .name == name :
421
420
cls .delete ("/models/{}/contents/{}" .format (id_ , item .id ))
421
+ # Return json stream to beginning of file content
422
+ files ["files" ][1 ].seek (0 )
422
423
return cls .post (
423
424
"/models/{}/contents" .format (id_ ),
424
425
files = files ,
You can’t perform that action at this time.
0 commit comments