Skip to content

Commit

Permalink
Make status not be mandatory
Browse files Browse the repository at this point in the history
will need to refactor this, very hacky atm
  • Loading branch information
greenw0lf committed Sep 26, 2024
1 parent ebda32b commit 52625c1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion whisper_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Status(Enum):
class Task(BaseModel):
input_uri: str
output_uri: str
status: Status = Status.CREATED
status: Status | None = Status.CREATED
id: str | None = None

def __init__(self, input_uri, output_uri, status):
Expand Down Expand Up @@ -120,6 +120,7 @@ async def create_task(
return {"msg": "The worker is currently processing a task. Try again later!"}
background_tasks.add_task(try_whisper, task)
task.id = str(uuid4())
task.status = Status.CREATED
current_task = task
task_dict = task.dict()
all_tasks.append(task_dict)
Expand Down

0 comments on commit 52625c1

Please sign in to comment.