-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Support custom model URL #1027
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
base: master
Are you sure you want to change the base?
Support custom model URL #1027
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
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 @universeroc)
toxicity/src/index.ts
line 37 at r1 (raw file):
* `identity_attack` | `insult` | `threat` | `sexual_explicit` | `obscene`. * Defaults to all labels. * @param modelURL Load a model from URL rather than tfhub.dev
Rephrase it to "URL to load model from. Defaults to tfhub.dev.
toxicity/src/index.ts
line 61 at r1 (raw file):
} setModelURL(url: string) {
Please make this private
571a8bb
to
b08beb3
Compare
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 @universeroc)
toxicity/src/index.ts
line 37 at r1 (raw file):
Previously, ahmedsabie wrote…
Rephrase it to "URL to load model from. Defaults to tfhub.dev.
Sorry I should have been clearer, the argument name should still stay as modelURL, so the whole line should be:
* @param modelURL. URL to load model from. Defaults to tfhub.dev.
Remove the duplicate Defaults to tfhub.dev on the next line as well.
toxicity/src/index.ts
line 41 at r2 (raw file):
*/ export async function load(threshold: number, toxicityLabels: string[], URL: 'https://tfhub.dev/tensorflow/tfjs-model/toxicity/1/default/1') {
rename argument back to modelURL
5b34adf
to
6e1d658
Compare
@ahmedsabie setModelURL should not be set private as in function |
I want to load a local model rather than tfhub.dev to improve the loading performance. But I can not load model except from tfhub.dev, so I make this patch to make it work, if there's another way to make it let me know, thank you in advance :)
This change is