Some updates regarding contributions

This commit is contained in:
Patrick Jentsch 2022-11-18 11:51:41 +01:00
parent 3004334d05
commit 821571e97f
4 changed files with 19 additions and 15 deletions

View File

@ -42,7 +42,6 @@
version: '3.2.0' version: '3.2.0'
compatible_service_versions: compatible_service_versions:
- '0.1.0' - '0.1.0'
- 'test'
- title: 'Spanish' - title: 'Spanish'
description: 'Spanish pipeline optimized for CPU. Components: tok2vec, morphologizer, parser, senter, ner, attribute_ruler, lemmatizer.' description: 'Spanish pipeline optimized for CPU. Components: tok2vec, morphologizer, parser, senter, ner, attribute_ruler, lemmatizer.'
url: 'https://github.com/explosion/spacy-models/releases/download/es_core_news_md-3.2.0/es_core_news_md-3.2.0.tar.gz' url: 'https://github.com/explosion/spacy-models/releases/download/es_core_news_md-3.2.0/es_core_news_md-3.2.0.tar.gz'

View File

@ -1,6 +1,5 @@
from datetime import datetime, timedelta from datetime import datetime, timedelta
from enum import Enum, IntEnum from enum import Enum, IntEnum
import re
from flask import current_app, url_for from flask import current_app, url_for
from flask_hashids import HashidMixin from flask_hashids import HashidMixin
from flask_login import UserMixin from flask_login import UserMixin
@ -550,6 +549,10 @@ class TesseractOCRPipelineModel(FileMixin, HashidMixin, db.Model):
str(self.id) str(self.id)
) )
@property
def jsonpatch_path(self):
return f'{self.user.jsonpatch_path}/tesseract_ocr_pipeline_models/{self.hashid}'
@property @property
def url(self): def url(self):
return url_for( return url_for(
@ -557,6 +560,10 @@ class TesseractOCRPipelineModel(FileMixin, HashidMixin, db.Model):
tesseract_ocr_pipeline_model_id=self.id tesseract_ocr_pipeline_model_id=self.id
) )
@property
def user_hashid(self):
return self.user.hashid
@staticmethod @staticmethod
def insert_defaults(): def insert_defaults():
nopaque_user = User.query.filter_by(username='nopaque').first() nopaque_user = User.query.filter_by(username='nopaque').first()
@ -665,6 +672,10 @@ class SpaCyNLPPipelineModel(FileMixin, HashidMixin, db.Model):
str(self.id) str(self.id)
) )
@property
def jsonpatch_path(self):
return f'{self.user.jsonpatch_path}/spacy_nlp_pipeline_models/{self.hashid}'
@property @property
def url(self): def url(self):
return url_for( return url_for(
@ -672,6 +683,10 @@ class SpaCyNLPPipelineModel(FileMixin, HashidMixin, db.Model):
spacy_nlp_pipeline_model_id=self.id spacy_nlp_pipeline_model_id=self.id
) )
@property
def user_hashid(self):
return self.user.hashid
@staticmethod @staticmethod
def insert_defaults(): def insert_defaults():
nopaque_user = User.query.filter_by(username='nopaque').first() nopaque_user = User.query.filter_by(username='nopaque').first()

View File

@ -123,12 +123,7 @@ class SpaCyNLPPipelineModelList extends RessourceList {
let spaCyNLPPipelineModelId = spaCyNLPPipelineModelElement.dataset.id; let spaCyNLPPipelineModelId = spaCyNLPPipelineModelElement.dataset.id;
switch (action) { switch (action) {
case 'share-request': { case 'share-request': {
let shared; let shared = actionSwitchElement.querySelector('input').checked;
if (actionSwitchElement.querySelector('input').checked) {
shared = true;
} else {
shared = false;
}
Utils.shareSpaCyNLPPipelineModelRequest(this.userId, spaCyNLPPipelineModelId, shared); Utils.shareSpaCyNLPPipelineModelRequest(this.userId, spaCyNLPPipelineModelId, shared);
break; break;
} }

View File

@ -123,12 +123,7 @@ class TesseractOCRPipelineModelList extends RessourceList {
let tesseractOCRPipelineModelId = tesseractOCRPipelineModelElement.dataset.id; let tesseractOCRPipelineModelId = tesseractOCRPipelineModelElement.dataset.id;
switch (action) { switch (action) {
case 'share-request': { case 'share-request': {
let shared; let shared = actionSwitchElement.querySelector('input').checked;
if (actionSwitchElement.querySelector('input').checked) {
shared = true;
} else {
shared = false;
}
Utils.shareTesseractOCRPipelineModelRequest(this.userId, tesseractOCRPipelineModelId, shared); Utils.shareTesseractOCRPipelineModelRequest(this.userId, tesseractOCRPipelineModelId, shared);
break; break;
} }