-
Notifications
You must be signed in to change notification settings - Fork 950
Conversation
for saving model artifacts to browser IndexedDB and loading them. Towards: tensorflow/tfjs#13
Hello all I am e beginner in open source and have a basic knowledge of javascript and want to get started with contributing to this project!Can somebody please help me?I also know a bit of NLP and deep learning. |
@arunikayadav42 Great to see you are interested in contributing. Maybe you can take a look at the list of our issues with the "help wanted" tag and see which ones interest you. https://github.com/tensorflow/tfjs/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22 |
Review status: 0 of 3 files reviewed at latest revision, all discussions resolved. src/io/indexed_db.ts, line 35 at r2 (raw file):
simplify these:
src/io/indexed_db.ts, line 45 at r2 (raw file):
Can you add an environment flag for the environment? Maybe called "IS_NODE" so we don't have these checks sprinkled everywhere? Add in 3 places: src/io/indexed_db.ts, line 55 at r2 (raw file):
not all browsers support this, should we throw if it's null? src/io/indexed_db.ts, line 83 at r2 (raw file):
this seems to be pretty common -- maybe pull out into a util. src/io/indexed_db.ts, line 96 at r2 (raw file):
src/io/indexed_db.ts, line 113 at r2 (raw file):
follow this convention elsewhere where you can as well, you dont need the {} for single-line body callbacks. src/io/indexed_db.ts, line 127 at r2 (raw file):
src/io/indexed_db.ts, line 138 at r2 (raw file):
double equals null src/io/indexed_db.ts, line 149 at r2 (raw file):
src/io/indexed_db.ts, line 153 at r2 (raw file):
src/io/indexed_db.ts, line 166 at r2 (raw file):
Same comment here: "Creates a browser IndexedDB IOHandler for saving models." Comments from Reviewable |
Review status: 0 of 3 files reviewed at latest revision, 11 unresolved discussions. src/io/indexed_db.ts, line 59 at r2 (raw file):
Please add something analogous to the local_storage comment here.
src/io/indexed_db.ts, line 161 at r2 (raw file):
This method can fail. It seems it's ok if it fails because the objectStore already exists, but some of the other reasons should maybe be caught? Comments from Reviewable |
Review status: 0 of 6 files reviewed at latest revision, 13 unresolved discussions. src/io/indexed_db.ts, line 35 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/io/indexed_db.ts, line 45 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
I don't feel I'm familiar with src/io/indexed_db.ts, line 55 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Good point. Done. src/io/indexed_db.ts, line 59 at r2 (raw file): Previously, bileschi (Stanley Bileschi) wrote…
Done. src/io/indexed_db.ts, line 83 at r2 (raw file):
src/io/indexed_db.ts, line 96 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/io/indexed_db.ts, line 113 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. Simplified all places like this in this file. src/io/indexed_db.ts, line 127 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/io/indexed_db.ts, line 138 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/io/indexed_db.ts, line 149 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/io/indexed_db.ts, line 153 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. src/io/indexed_db.ts, line 161 at r2 (raw file):
If this method fails, it should throw an error and the error will surface in the BrowserIndexedDB.save and .load calls. src/io/indexed_db.ts, line 166 at r2 (raw file): Previously, nsthorat (Nikhil Thorat) wrote…
Done. Added the word "loading" as the returned IOHandler also supports loading. Comments from Reviewable |
Review status: 0 of 6 files reviewed at latest revision, 13 unresolved discussions. src/io/indexed_db.ts, line 153 at r2 (raw file): Previously, caisq (Shanqing Cai) wrote…
still has braces src/io/indexed_db.ts, line 75 at r3 (raw file):
!modelPath also check modelPath === null src/io/indexed_db.ts, line 94 at r3 (raw file):
the database code for save and load method are quite similar, maybe better to refactor to a wrapper class that src/io/indexed_db.ts, line 122 at r3 (raw file):
will read be enough? src/io/indexed_db.ts, line 127 at r3 (raw file):
use === src/io/indexed_db_test.ts, line 135 at r3 (raw file):
since you are using done, is the async still needed? Comments from Reviewable |
Review status: 0 of 6 files reviewed at latest revision, 18 unresolved discussions. src/io/indexed_db.ts, line 153 at r2 (raw file): Previously, pyu10055 (Ping Yu) wrote…
Done. src/io/indexed_db.ts, line 94 at r3 (raw file): Previously, pyu10055 (Ping Yu) wrote…
Done. Thanks for the suggestion. src/io/indexed_db.ts, line 127 at r3 (raw file): Previously, pyu10055 (Ping Yu) wrote…
Done. Using src/io/indexed_db_test.ts, line 135 at r3 (raw file): Previously, pyu10055 (Ping Yu) wrote…
Good point. Comments from Reviewable |
2055ee7
to
d2b8790
Compare
Reviewed 4 of 5 files at r3, 2 of 2 files at r4. src/io/indexed_db.ts, line 29 at r4 (raw file):
typo Comments from Reviewable |
Review status: 5 of 6 files reviewed at latest revision, 19 unresolved discussions, some commit checks failed. src/io/indexed_db.ts, line 29 at r4 (raw file): Previously, davidsoergel (David Soergel) wrote…
Done. Comments from Reviewable |
Nice work! Sorry for delay - things are a little busy. Left a few comments but nothing blocking, thus LGTM Review status: 5 of 6 files reviewed at latest revision, 19 unresolved discussions. src/io/browser_files.ts, line 39 at r4 (raw file):
todo's are easy to forget about. better to file an issue and link to it: e.g. TODO(tensorflow/tfjs#999): .../ src/io/indexed_db.ts, line 59 at r2 (raw file): Previously, caisq (Shanqing Cai) wrote…
Since we are not going to expose this class, I think there is no need for the jsdoc, because it's another thing to keep in sync if we rename things. Also src/io/indexed_db.ts, line 21 at r5 (raw file):
remove extra newline src/io/indexed_db.ts, line 44 at r5 (raw file):
remove todo and file an issue. this way we open the door to discussion and potential contributors that can tackle this problem. src/io/indexed_db.ts, line 120 at r5 (raw file):
double checking src/io/indexed_db.ts, line 178 at r5 (raw file):
since there are no special methods on specific src/io/indexed_db_test.ts, line 25 at r5 (raw file):
describeWithFlags('IndexedDB', CPU_ENVS, () => { ...} to constraint it to run only on cpu, otherwise this test will fail on node environment, Also no need to run this explicitly on webgl either. We will need to fix the other tests (e.g. localStorage) to also run only on cpu. See tensorflow/tfjs#279 src/io/local_storage.ts, line 38 at r5 (raw file):
typeof window === 'undefined' Comments from Reviewable |
Review status: 5 of 6 files reviewed at latest revision, 25 unresolved discussions, all commit checks successful. src/io/indexed_db.ts, line 45 at r2 (raw file): Previously, caisq (Shanqing Cai) wrote…
Sounds good! src/io/indexed_db.ts, line 138 at r2 (raw file): Previously, caisq (Shanqing Cai) wrote…
I still see triple equals undefined. Prefer double equals null. src/io/indexed_db.ts, line 127 at r3 (raw file): Previously, caisq (Shanqing Cai) wrote…
You shouldn't be using === undefined here (see comment above). Comments from Reviewable |
Review status: 5 of 6 files reviewed at latest revision, 25 unresolved discussions, some commit checks failed. src/io/indexed_db.ts, line 59 at r2 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
It doesn't hurt to have the doc string here. src/io/indexed_db.ts, line 75 at r3 (raw file): Previously, pyu10055 (Ping Yu) wrote…
=== null is covered in == null src/io/indexed_db.ts, line 122 at r3 (raw file): Previously, pyu10055 (Ping Yu) wrote…
Using more restrictive permissions in the new helper function ( src/io/indexed_db.ts, line 127 at r3 (raw file):
OK. Sorry about the back and forth. I agree with Nikhil that src/io/indexed_db.ts, line 21 at r5 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
Done. src/io/indexed_db.ts, line 44 at r5 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
Filed. tensorflow/tfjs#282 I'll keep the TODO item here just so it's easy to understand what the issues is talking about. src/io/indexed_db.ts, line 120 at r5 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
They seem to be built-in types for TypeScript. src/io/indexed_db.ts, line 178 at r5 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
I agree. Done. Using the same pattern elsewhere as well. src/io/indexed_db_test.ts, line 25 at r5 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
Done. src/io/local_storage.ts, line 38 at r5 (raw file): Previously, dsmilkov (Daniel Smilkov) wrote…
Done. Comments from Reviewable |
a8e1e7c
to
4987bed
Compare
Reviewed 2 of 5 files at r3, 6 of 6 files at r6. src/io/indexed_db.ts, line 75 at r3 (raw file): Previously, caisq (Shanqing Cai) wrote…
according ts style guide, always use === http://go/tsstyle#equality-checks Comments from Reviewable |
for saving model artifacts to browser IndexedDB and loading them.
Towards: tensorflow/tfjs#13
This change is