Instructions to use yummyfiles/Bob with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers.js
How to use yummyfiles/Bob with Transformers.js:
// npm i @huggingface/transformers import { pipeline } from '@huggingface/transformers'; // Allocate pipeline const pipe = await pipeline('text-generation', 'yummyfiles/Bob');
| with open('app.js', 'r', encoding='utf-8') as f: | |
| content = f.read() | |
| lines = content.split('\n') | |
| for i, line in enumerate(lines): | |
| if 'escapeHtml' in line and 'function' in line: | |
| lines[i] = 'function escapeHtml(s) { return s.replace(/[&<>]/g, c => ({"&":"&","<":"<",">":">"}[c])); }' | |
| print(f'Fixed line {i+1}') | |
| with open('app.js', 'w', encoding='utf-8') as f: | |
| f.write('\n'.join(lines)) | |
| print('Done') |