From 5ff1f91d9b5179338d8f037d2850c1f5fde315f7 Mon Sep 17 00:00:00 2001 From: Mike Ferguson Date: Fri, 2 Feb 2024 14:25:33 -0500 Subject: [PATCH] Removed public/private submissions and brain/base models for vision --- benchmarks/forms.py | 15 +-------------- benchmarks/views/user.py | 12 +++--------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/benchmarks/forms.py b/benchmarks/forms.py index 5a981717f..2fa99aff3 100644 --- a/benchmarks/forms.py +++ b/benchmarks/forms.py @@ -36,19 +36,6 @@ class UploadPlaceHolder(forms.Form): class UploadFileForm(forms.Form): - model_type = forms.ChoiceField(choices=[ - ("BaseModel", "Base model - to submit a standard machine learning model"), - ("BrainModel", "Brain model - to change brain-transformation")]) - zip_file = forms.FileField(label="", help_text='Required') - public = forms.BooleanField(label='Make model scores public (can be changed later):', required=False, - help_text='Check if you want the results of your submitted models included in the public ranking.') - - class Meta: - model = UploadPlaceHolder - fields = ('zip_file', 'public', 'competition') - - -class UploadFileFormLanguage(forms.Form): zip_file = forms.FileField(label="", help_text='Required') class Meta: @@ -62,4 +49,4 @@ def __init__(self, *args, **kwargs): self.fields.pop('old_password') class Meta: - fields = ('new_password1', 'new_password2') + fields = ('new_password1', 'new_password2') \ No newline at end of file diff --git a/benchmarks/views/user.py b/benchmarks/views/user.py index 0535bbc1f..ad7e9a575 100644 --- a/benchmarks/views/user.py +++ b/benchmarks/views/user.py @@ -18,7 +18,7 @@ from django.utils.http import urlsafe_base64_encode, urlsafe_base64_decode from django.views import View -from benchmarks.forms import SignupForm, LoginForm, UploadFileForm, UploadFileFormLanguage +from benchmarks.forms import SignupForm, LoginForm, UploadFileForm from benchmarks.models import Model, BenchmarkInstance, BenchmarkType from benchmarks.tokens import account_activation_token from benchmarks.views.index import get_context @@ -153,18 +153,12 @@ def get(self, request): assert self.domain is not None if request.user.is_anonymous: return HttpResponseRedirect(f'../profile/{self.domain}') - if self.domain == "language": - form = UploadFileFormLanguage() - else: - form = UploadFileForm() + form = UploadFileForm() return render(request, 'benchmarks/upload.html', {'form': form, 'domain': self.domain}) def post(self, request): assert self.domain is not None - if self.domain == "language": - form = UploadFileFormLanguage(request.POST, request.FILES) - else: - form = UploadFileForm(request.POST, request.FILES) + form = UploadFileForm(request.POST, request.FILES) if not form.is_valid(): return HttpResponse("Form is invalid", status=400)