Skip to content

Fetch data from GitHub repo as JSON doesn't work #1485

Description

@konvasil

I want to load some data from a JSON file which is stored in GitHub, the data is printed in Chrome's console as expected and as soon as is fetched but when I try to load it for the neural network with loadData(....) it doesn't work.

 //load data from GitHub
    if(key == 'f' && state == 'waiting') {
        const fetchPromise = fetch("myUrl")

        fetchPromise
            .then((response) => response.json())
            .then((raw) => {
                remoteLoad(raw)
            })
    }

function remoteLoad(data){
    console.log(options)
    brain.loadData(data, dataLoaded)
}

```


- **Web browser & version**:
- Chrome
- **Operating System**:
- MacOS Ventura
- **ml5 version you're using**:
- * Tone.js v14.7.77 *

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions