Instructions to use Subject-Emu-5259/NeuralAI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Subject-Emu-5259/NeuralAI with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
| <html> | |
| <head><title>SSE Test</title></head> | |
| <body> | |
| <h1>SSE Test</h1> | |
| <div id="output" style="border: 1px solid #333; padding: 20px; min-height: 100px; white-space: pre-wrap;"></div> | |
| <script> | |
| async function test() { | |
| const resp = await fetch('/api/chat', { | |
| method: 'POST', | |
| headers: { 'Content-Type': 'application/json' }, | |
| body: JSON.stringify({messages: [{role:'user', content:'hi'}], use_uplink: false}) | |
| }); | |
| const reader = resp.body.getReader(); | |
| const decoder = new TextDecoder(); | |
| const out = document.getElementById('output'); | |
| let count = 0; | |
| while (true) { | |
| const { done, value } = await reader.read(); | |
| if (done) break; | |
| const chunk = decoder.decode(value, { stream: true }); | |
| out.textContent += 'CHUNK ' + (++count) + ': ' + chunk.substring(0, 200) + '\n'; | |
| } | |
| out.textContent += '\n=== DONE ==='; | |
| } | |
| test().catch(e => out.textContent = 'ERROR: ' + e); | |
| </script> | |
| </body> | |
| </html> | |