Jofthomas commited on
Commit
f5e9274
·
verified ·
1 Parent(s): e946ee0

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -3,7 +3,7 @@ import pandas as pd
3
  from fastapi import FastAPI, HTTPException, Body
4
  from fastapi.responses import FileResponse
5
  from pydantic import BaseModel, Field
6
- from typing import List, Dict, Any, Optional
7
  from datasets import load_dataset, Dataset, DatasetDict
8
  from huggingface_hub import HfApi, hf_hub_download
9
  from datetime import datetime, timezone
@@ -170,7 +170,7 @@ class ErrorResponse(BaseModel):
170
 
171
  class AnswerItem(BaseModel):
172
  task_id: str
173
- submitted_answer: str = Field(..., description="The agent's answer for the task_id")
174
 
175
  class Submission(BaseModel):
176
  username: str = Field(..., description="Hugging Face username", min_length=1)
 
3
  from fastapi import FastAPI, HTTPException, Body
4
  from fastapi.responses import FileResponse
5
  from pydantic import BaseModel, Field
6
+ from typing import List, Dict, Any, Optional, Union
7
  from datasets import load_dataset, Dataset, DatasetDict
8
  from huggingface_hub import HfApi, hf_hub_download
9
  from datetime import datetime, timezone
 
170
 
171
  class AnswerItem(BaseModel):
172
  task_id: str
173
+ submitted_answer: Union[str, int, float] = Field(..., description="The agent's answer for the task_id. Accepts str, int and float")
174
 
175
  class Submission(BaseModel):
176
  username: str = Field(..., description="Hugging Face username", min_length=1)