(question)
| 54 | const instruction = `A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.` |
| 55 | |
| 56 | function format_prompt(question) { |
| 57 | return `${instruction}\n${ |
| 58 | chat.map(m =>`### Human: ${m.human}\n### Assistant: ${m.assistant}`).join("\n") |
| 59 | }\n### Human: ${question}\n### Assistant:` |
| 60 | } |
| 61 | |
| 62 | async function tokenize(content) { |
| 63 | const result = await fetch(`${API_URL}/tokenize`, { |