Browse Source

Update AutoLabelingConfigParameterTest API

pull/1413/head
Hironsan 3 years ago
parent
commit
0812f0c6d0
1 changed files with 7 additions and 1 deletions
  1. 8
      backend/api/views/auto_labeling.py

8
backend/api/views/auto_labeling.py

@ -9,6 +9,7 @@ from auto_labeling_pipeline.pipeline import pipeline
from auto_labeling_pipeline.postprocessing import PostProcessor
from auto_labeling_pipeline.task import TaskFactory
from django.shortcuts import get_object_or_404
from django_drf_filepond.models import TemporaryUpload
from rest_framework import generics, status
from rest_framework.exceptions import ValidationError
from rest_framework.permissions import IsAuthenticated
@ -139,7 +140,12 @@ class AutoLabelingConfigParameterTest(APIView):
raise e
def prepare_example(self):
return self.request.data['text']
text = self.request.data['text']
if self.project.is_task_of('text'):
return text
else:
tu = TemporaryUpload.objects.get(upload_id=text)
return tu.get_file_path()
def post(self, *args, **kwargs):
model = self.create_model()

Loading…
Cancel
Save