-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enh(tensorflow-serving/webservice): provide meta information such as …
…tf model and JETSON_MODEL as well as timestamp and duration; provide make target to access public endpoint on polarize.ai
- Loading branch information
1 parent
2de8877
commit 98b4745
Showing
8 changed files
with
60 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
workflow/deploy/tensorflow-serving/src/webservice/prediction/model.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from pydantic import BaseModel | ||
from typing import List | ||
|
||
class Request(BaseModel): | ||
instances: List[float] = [] | ||
|
||
class ResponseMeta(BaseModel): | ||
model_name: str | ||
jetson_model: str | ||
duration: int # milliseconds | ||
timestamp: int | ||
|
||
class Response(BaseModel): | ||
predictions: List[float] = [] | ||
meta: ResponseMeta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
6 changes: 6 additions & 0 deletions
6
workflow/deploy/tensorflow-serving/src/webservice/util/util.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
def millis_interval(start, end): | ||
diff = end - start | ||
millis = diff.days * 24 * 60 * 60 * 1000 | ||
millis += diff.seconds * 1000 | ||
millis += diff.microseconds / 1000 | ||
return int(round(millis)) |