aboutsummaryrefslogtreecommitdiff
path: root/backend/api
diff options
context:
space:
mode:
Diffstat (limited to 'backend/api')
-rw-r--r--backend/api/api/Controllers/ModelController.cs8
-rw-r--r--backend/api/api/Models/Model.cs1
-rw-r--r--backend/api/api/Services/FillAnEmptyDb.cs3
3 files changed, 8 insertions, 4 deletions
diff --git a/backend/api/api/Controllers/ModelController.cs b/backend/api/api/Controllers/ModelController.cs
index 3145a080..c9e36ca4 100644
--- a/backend/api/api/Controllers/ModelController.cs
+++ b/backend/api/api/Controllers/ModelController.cs
@@ -195,8 +195,8 @@ namespace api.Controllers
var existingModel = _modelService.GetOneModel(model.uploaderId, model.name);
- if (existingModel != null && !overwrite)
- return NotFound($"Model with name = {model.name} exisits");
+ if (existingModel != null && !overwrite && model.validationSize < 1 && model.validationSize > 0)
+ return NotFound($"Model with name = {model.name} exisits or validation size is not between 0-1");
else
{
//_modelService.Create(model);
@@ -225,8 +225,8 @@ namespace api.Controllers
var existingModel = _modelService.GetOneModel(userId, name);
- if (existingModel == null)
- return NotFound($"Model with name = {name} or user with ID = {userId} not found");
+ if (existingModel == null && model.validationSize < 1 && model.validationSize > 0)
+ return NotFound($"Model with name = {name} or validation size is not between 0-1");
_modelService.Update(userId, name, model);
return NoContent();
diff --git a/backend/api/api/Models/Model.cs b/backend/api/api/Models/Model.cs
index a2740ca9..f09940d0 100644
--- a/backend/api/api/Models/Model.cs
+++ b/backend/api/api/Models/Model.cs
@@ -43,6 +43,7 @@ namespace api.Models
public float randomTestSetDistribution { get; set; }
public bool isPublic { get; set; }
public bool accessibleByLink { get; set; }
+ public float validationSize { get; set; }//0-1 ne ukljucuje 0.1-0.9 ogranici
}
public class Layer
diff --git a/backend/api/api/Services/FillAnEmptyDb.cs b/backend/api/api/Services/FillAnEmptyDb.cs
index 69f534d8..32ce5c2e 100644
--- a/backend/api/api/Services/FillAnEmptyDb.cs
+++ b/backend/api/api/Services/FillAnEmptyDb.cs
@@ -106,6 +106,7 @@ namespace api.Services
model.epochs = 5;
model.isPublic = true;
model.accessibleByLink = true;
+ model.validationSize = 0.1f;//proveri
_modelService.Create(model);
@@ -220,6 +221,7 @@ namespace api.Services
model.epochs = 5;
model.isPublic = true;
model.accessibleByLink = true;
+ model.validationSize = 0.1f;//proveri
_modelService.Create(model);
@@ -333,6 +335,7 @@ namespace api.Services
model.epochs = 1;
model.isPublic = true;
model.accessibleByLink = true;
+ model.validationSize = 0.1f;//proveri
_modelService.Create(model);