-
Notifications
You must be signed in to change notification settings - Fork 950
add support for binary model loading through browser http handler #1207
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 approvals obtained (waiting on @pyu10055 and @caisq)
src/io/browser_http.ts, line 53 at r1 (raw file):
length
nit: s/length/a length/
Also, it would be helpful to print out the actual length of of path
here, because that helps user debugging their code.
src/io/browser_http.ts, line 137 at r1 (raw file):
private
Maybe slightly better to make it protected, to make inheritance possible in the future.
src/io/browser_http.ts, line 147 at r1 (raw file):
let weightSpecs: WeightsManifestEntry[];
There is a lot of code duplication between this method and loadJSONModel()
in terms of the weight-loading code. Can you factor the code out into a separate private method, perhaps called loadWeights()
src/io/browser_http.ts, line 173 at r1 (raw file):
private
Same as above. Maybe slightly better to make it protected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 approvals obtained (waiting on @pyu10055 and @caisq)
src/io/browser_http.ts, line 52 at r1 (raw file):
path.length === 2,
In addition, add a unit test for this error condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 approvals obtained (waiting on @caisq and @pyu10055)
src/io/browser_http.ts, line 52 at r1 (raw file):
Previously, caisq (Shanqing Cai) wrote…
path.length === 2,
In addition, add a unit test for this error condition.
there is a unit test at the end of the test file.
src/io/browser_http.ts, line 53 at r1 (raw file):
Previously, caisq (Shanqing Cai) wrote…
length
nit: s/length/a length/
Also, it would be helpful to print out the actual length of of
path
here, because that helps user debugging their code.
Done.
src/io/browser_http.ts, line 137 at r1 (raw file):
Previously, caisq (Shanqing Cai) wrote…
private
Maybe slightly better to make it protected, to make inheritance possible in the future.
Done.
src/io/browser_http.ts, line 147 at r1 (raw file):
Previously, caisq (Shanqing Cai) wrote…
let weightSpecs: WeightsManifestEntry[];
There is a lot of code duplication between this method and
loadJSONModel()
in terms of the weight-loading code. Can you factor the code out into a separate private method, perhaps calledloadWeights()
Done.
src/io/browser_http.ts, line 173 at r1 (raw file):
Previously, caisq (Shanqing Cai) wrote…
private
Same as above. Maybe slightly better to make it protected.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 approvals obtained (waiting on @caisq and @pyu10055)
src/io/browser_http.ts, line 151 at r2 (raw file):
for (const entry of weightsManifest) { weightSpecs.push(...entry.weights);
Can these lines be factored into loadWeightData
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 approvals obtained (waiting on @caisq)
src/io/browser_http.ts, line 151 at r2 (raw file):
Previously, caisq (Shanqing Cai) wrote…
for (const entry of weightsManifest) { weightSpecs.push(...entry.weights);
Can these lines be factored into
loadWeightData
as well?
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 1 approvals obtained (waiting on @caisq)
Description
this would allow frozen model to be load through http io handler, which checks fetch polyfill.
For repository owners only:
Please remember to apply all applicable tags to your pull request.
Tags: FEATURE, BREAKING, BUG, PERF, DEV, DOC, SECURITY
For more info see: /~https://github.com/tensorflow/tfjs/blob/master/DEVELOPMENT.md
This change is