mirror of https://github.com/doccano/doccano.git
pythondatasetnatural-language-processingdata-labelingmachine-learningannotation-tooldatasetsactive-learningtext-annotation
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
547 B
28 lines
547 B
from celery import shared_task
|
|
from django.conf import settings
|
|
from django_drf_filepond.api import store_upload
|
|
from django_drf_filepond.models import TemporaryUpload
|
|
|
|
from .models import Document, Label
|
|
|
|
|
|
@shared_task
|
|
def add(x, y):
|
|
return x + y
|
|
|
|
|
|
@shared_task
|
|
def mul(x, y):
|
|
return x * y
|
|
|
|
|
|
@shared_task
|
|
def xsum(numbers):
|
|
return sum(numbers)
|
|
|
|
|
|
@shared_task
|
|
def parse(upload_id):
|
|
tu = TemporaryUpload.objects.get(upload_id=upload_id)
|
|
su = store_upload(upload_id, destination_file_path=tu.upload_name)
|
|
return su.file.path
|