Download app.js from simplex5/sf-68d: direct link, hf CLI and curl.
- Browser
- Download file 769 Bytes
-
https://huggingface.co/spaces/simplex5/sf-68d/resolve/main/app.js
- Command line
-
hf download hf://spaces/simplex5/sf-68d/app.js
-
curl -L -o app.js https://huggingface.co/spaces/simplex5/sf-68d/resolve/main/app.js
769 Bytes
| import SafeteansLLM from './safeteans-llm'; | |
| class App { | |
| constructor({ el, data, methods, created }) { | |
| // Create the LLM instance | |
| this.llm = new SafeteansLLM(); | |
| // Mount the root component | |
| this.render([{ | |
| el: el, | |
| data: data, | |
| methods: methods, | |
| created: created, | |
| }]); | |
| } | |
| render({ el, data, methods, created }) { | |
| // Create the element | |
| const element = createElement(el); | |
| // Set the data and methods | |
| Object.keys(data).forEach(key => element.dataset[key] = data[key]); | |
| Object.keys(methods).forEach(key => element[key] = methods[key]); | |
| // Set the created callback | |
| if (created) created(element); | |
| // Append the element to the body | |
| document.body.appendChild(element); | |
| } | |
| } | |
| export default App; |