Skip to content

Commit f94d115

Browse files
committed
add inference integration tests and update external job to allow blank values
1 parent 0e854c3 commit f94d115

File tree

4 files changed

+225
-179
lines changed

4 files changed

+225
-179
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 4.2.9 on 2025-02-27 18:12
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("inference", "0001_initial"),
10+
]
11+
12+
operations = [
13+
migrations.AlterField(
14+
model_name="externaljob",
15+
name="error_message",
16+
field=models.TextField(blank=True, null=True),
17+
),
18+
migrations.AlterField(
19+
model_name="externaljob",
20+
name="results",
21+
field=models.JSONField(blank=True, null=True),
22+
),
23+
]

inference/models/inference.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def initiate(self, inference_api_url=settings.INFERENCE_API_URL) -> None:
147147
"""Initialize job and create batches"""
148148
try:
149149
# Load model using the refactored API client
150-
api_client = InferenceAPIClient(inference_api_url=inference_api_url)
150+
api_client = InferenceAPIClient(base_url=inference_api_url)
151151
if not api_client.load_model(self.model_version.api_identifier):
152152
# TODO: should refactor to get an exact error out of the api client
153153
self.log_error_and_set_status_failed("Failed to load model")
@@ -219,8 +219,8 @@ class ExternalJob(models.Model):
219219
url_ids = models.JSONField(help_text="List of URL IDs included in this batch")
220220

221221
status = models.IntegerField(choices=ExternalJobStatus.choices, default=ExternalJobStatus.QUEUED)
222-
results = models.JSONField(blank=True)
223-
error_message = models.TextField(blank=True)
222+
results = models.JSONField(blank=True, null=True)
223+
error_message = models.TextField(blank=True, null=True)
224224

225225
created_at = models.DateTimeField(default=timezone.now)
226226
updated_at = models.DateTimeField(auto_now=True)

inference/tests/local_test_inference_integration.py

Lines changed: 0 additions & 176 deletions
This file was deleted.

0 commit comments

Comments
 (0)