Skip to content

Commit

Permalink
Merge pull request #202 from jdi-testing/issue_1598-Pass-screen-resol…
Browse files Browse the repository at this point in the history
…ution-to-selenoid

Viewport model type changed
  • Loading branch information
ivnglkv authored Aug 27, 2024
2 parents fdf049f + c3c8906 commit 9a96c17
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
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

0 comments on commit 9a96c17

Please sign in to comment.