mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 10:54:18 +00:00
allow .whl files for spacy nlp pipeline contributions
This commit is contained in:
parent
05ab204e5a
commit
cf8c164d60
@ -16,8 +16,8 @@ class CreateSpaCyNLPPipelineModelForm(ContributionBaseForm):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def validate_spacy_model_file(self, field):
|
def validate_spacy_model_file(self, field):
|
||||||
if not field.data.filename.lower().endswith('.tar.gz'):
|
if not field.data.filename.lower().endswith(('.tar.gz', ('.whl'))):
|
||||||
raise ValidationError('.tar.gz files only!')
|
raise ValidationError('.tar.gz or .whl files only!')
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
if 'prefix' not in kwargs:
|
if 'prefix' not in kwargs:
|
||||||
|
@ -42,7 +42,7 @@
|
|||||||
{{ form.hidden_tag() }}
|
{{ form.hidden_tag() }}
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col s12 l5">
|
<div class="col s12 l5">
|
||||||
{{ wtf.render_field(form.spacy_model_file, accept='.tar.gz', placeholder='Choose a .tar.gz file') }}
|
{{ wtf.render_field(form.spacy_model_file, accept='.tar.gz,.whl', placeholder='Choose a .tar.gz or .whl file') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col s12 l7">
|
<div class="col s12 l7">
|
||||||
{{ wtf.render_field(form.title, material_icon='title') }}
|
{{ wtf.render_field(form.title, material_icon='title') }}
|
||||||
|
Loading…
Reference in New Issue
Block a user