File size: 1,051 Bytes
5bb3658
a50e97a
48058b8
 
45610e5
48058b8
5bb3658
45610e5
7c97f0e
49882a1
 
48058b8
 
 
45610e5
48058b8
 
 
49882a1
48058b8
45610e5
48058b8
45610e5
5bb3658
45610e5
 
 
 
 
 
 
 
48058b8
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Тест ggml.js</title>
</head>
<body>
    <h2>🧪 ggml.js + Llama</h2>
    <div id="status">⏳ Загрузка...</div>
    <div id="answer"></div>

    <script type="importmap">
    {
        "imports": {
            "ggml": "https://cdn.jsdelivr.net/npm/ggml.js/+esm"
        }
    }
    </script>

    <script type="module">
        import * as ggml from 'ggml';

        const url = 'https://huggingface.co/bartowski/Llama-3-ChatQA-1.5-8B-GGUF/resolve/main/ChatQA-1.5-8B-Q4_K_M.gguf';

        try {
            const model = await ggml.load(url);
            document.getElementById('status').textContent = '✅ Модель загружена!';
            
            const result = await model.generate('Привет, Маруся!');
            document.getElementById('answer').textContent = '🌸 ' + result;
        } catch (e) {
            document.getElementById('status').textContent = '❌ Ошибка: ' + e.message;
        }
    </script>
</body>
</html>