Skip to content
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

Point CharRNN examples to model files hosted in ml5-data-and-models repo #1186

Merged
merged 1 commit into from
Apr 19, 2021

Conversation

bomanimc
Copy link
Member

@bomanimc bomanimc commented Apr 16, 2021

Fixes #1123. Fixes #866.

Community members flagged issues loading models backing the CharRNN examples on the p5.js Web Editor. This issue was occurring because the models, which are JSON files, we're correctly being loaded as assets by p5.js Web Editor. Instead of storing the models in the example, I realized we could also just use the hosted version of this in ml5-data-and-models.

There's a risk in using models in the ml5-data-and-models repo because, should anyone change the directory structure in that repo, our examples would silently break. The benefit, though, is that we don't have to store duplicates of the same sizable model files in every CharRNN example. Longterm, we should probably move these assets to be hosted on a more popular CDN (e.g. AWS S3), but in the meantime, I think this is a good interim solution that fixes the issue.

Verified changes by running the examples locally using npm run develop. I also tested my edit to use the hosted woolf model in p5.js web editor to confirm that it loads and correct the issue highlighted in #1123.

@bomanimc bomanimc changed the title Point CharRNN examples to model files hosted on ml5-data-and-models repo Point CharRNN examples to model files hosted in ml5-data-and-models repo Apr 16, 2021
Copy link
Contributor

@joeyklee joeyklee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 -- good call on this. Definitely will reduce the size of the repo + it can reinforce the idea that these models are either hosted somewhere remotely or locally and not magic!

@bomanimc
Copy link
Member Author

Opened #1188 to log this conversation about how we host our models!

@bomanimc bomanimc merged commit 4223a5b into main Apr 19, 2021
@bomanimc bomanimc deleted the bomani.charrnn-examples-load-hosted-model branch April 19, 2021 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CharRNN examples don't load model Byte length error on CharRNN Interactive p5 Example
2 participants