Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewport model type changed #202

Merged
merged 3 commits into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class PredictionRequestElement(BaseModel):
class PredictionInputModel(BaseModel):
document: str
elements: str
viewport: Dict
viewport: str


class PredictedElement(BaseModel):
Expand Down
2 changes: 1 addition & 1 deletion ds_methods/angular_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async def angular_predict_elements(body):
body_json = json.loads(body_str)
elements_json = body_json.get("elements", [])
document_json = body_json.get("document", "")
viewport_json = body_json.get("viewport", {})
viewport_json = json.loads(body_json.get("viewport", "{}"))

# create softmax layser function to get probabilities from logits
softmax = torch.nn.Softmax(dim=1)
Expand Down
2 changes: 1 addition & 1 deletion ds_methods/html5_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async def html5_predict_elements(body):
body_json = json.loads(body_str)
elements_json = body_json.get("elements", [])
document_json = body_json.get("document", "")
viewport_json = body_json.get("viewport", {})
viewport_json = json.loads(body_json.get("viewport", "{}"))

# generate temporary filename
filename = dt.datetime.now().strftime("%Y%m%d%H%M%S%f.json")
Expand Down
2 changes: 1 addition & 1 deletion ds_methods/mui_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async def mui_predict_elements(body):
body_json = json.loads(body_str)
elements_json = body_json.get("elements", [])
document_json = body_json.get("document", "")
viewport_json = body_json.get("viewport", {})
viewport_json = json.loads(body_json.get("viewport", "{}"))

# create softmax layser function to get probabilities from logits
softmax = torch.nn.Softmax(dim=1)
Expand Down