File size: 2,774 Bytes
ab9f226
dd1b723
 
b7429f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dd1b723
 
b7429f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dd1b723
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Transformers.js Playground</title>
    <link rel="stylesheet" href="style.css">
    <script type="module">
        import { pipeline } from 'https://cdn.jsdelivr.net/npm/@huggingface/[email protected]';
    </script>
    <script
        src="https://app.wonderchat.io/scripts/wonderchat.js"
        data-name="wonderchat"
        data-address="app.wonderchat.io"
        data-id="cmgwshpx30k5pa6jheslpcwop"
        data-widget-size="normal"
        data-widget-button-size="normal"
        data-movable="true"
        data-initial-open="true" 
        defer
    ></script>
</head>
<body>
    <header>
        <div class="header-content">
            <a href="https://huggingface.co/spaces/akhaliq/anycoder" target="_blank" class="anycoder-link">Built with anycoder</a>
            <h1>Transformers.js Playground</h1>
        </div>
    </header>
    
    <main>
        <div class="container">
            <div class="controls">
                <div class="model-selector">
                    <label for="task-select">Select Task:</label>
                    <select id="task-select">
                        <option value="text-classification">Text Classification</option>
                        <option value="sentiment-analysis">Sentiment Analysis</option>
                        <option value="question-answering">Question Answering</option>
                        <option value="text-generation">Text Generation</option>
                        <option value="translation">Translation</option>
                    </select>
                </div>
                
                <div class="device-toggle">
                    <label for="device-select">Device:</label>
                    <select id="device-select">
                        <option value="cpu">CPU (WASM)</option>
                        <option value="webgpu">GPU (WebGPU)</option>
                    </select>
                </div>
                
                <div class="input-section">
                    <textarea id="input-text" placeholder="Enter your text here..."></textarea>
                    <button id="run-btn">Run Model</button>
                </div>
            </div>
            
            <div class="output-section">
                <h3>Output:</h3>
                <div id="output" class="output-container">
                    <p class="placeholder">Results will appear here...</p>
                </div>
            </div>
        </div>
    </main>
    
    <footer>
        <p>Transformers.js Playground - Powered by Hugging Face</p>
    </footer>
    
    <script src="index.js"></script>
</body>
</html>