File: aboutInference.html

package info (click to toggle)
firefox 145.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 4,653,528 kB
  • sloc: cpp: 7,594,999; javascript: 6,459,658; ansic: 3,752,909; python: 1,403,455; xml: 629,809; asm: 438,679; java: 186,421; sh: 67,287; makefile: 19,169; objc: 13,086; perl: 12,982; yacc: 4,583; cs: 3,846; pascal: 3,448; lex: 1,720; ruby: 1,003; exp: 762; php: 436; lisp: 258; awk: 247; sql: 66; sed: 54; csh: 10
file content (223 lines) | stat: -rw-r--r-- 7,811 bytes parent folder | download | duplicates (2)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!doctype html>
<html>
  <head>
    <meta
      http-equiv="Content-Security-Policy"
      content="default-src chrome:;img-src data: blob:; object-src 'none'"
    />
    <meta name="color-scheme" content="light dark" />
    <title data-l10n-id="about-inference-title"></title>
    <link rel="stylesheet" href="chrome://global/content/aboutInference.css" />
    <link rel="localization" href="preview/aboutInference.ftl" />
    <script
      type="module"
      src="chrome://global/content/model-files-view.mjs"
    ></script>
    <script src="chrome://global/content/aboutInference.js"></script>
  </head>
  <body id="body">
    <div id="categories">
      <div
        class="category category-no-icon"
        selected="true"
        id="category-local-inference"
      >
        <span
          class="category-name"
          data-l10n-id="about-inference-category-local-inference"
        ></span>
      </div>
      <div class="category category-no-icon" id="category-models-storage">
        <span
          class="category-name"
          data-l10n-id="about-inference-category-models-storage"
        ></span>
      </div>
      <div class="category category-no-icon" id="category-benchmark">
        <span
          class="category-name"
          data-l10n-id="about-inference-category-benchmark"
        ></span>
      </div>
    </div>

    <div class="main-content">
      <div class="header">
        <h1
          id="sectionTitle"
          data-l10n-id="about-inference-header"
          class="header-name"
        ></h1>
        <p>
          <span data-l10n-id="about-inference-description"></span>

          <a
            href="https://firefox-source-docs.mozilla.org/toolkit/components/ml"
            data-l10n-id="about-inference-learn-more"
          ></a>
        </p>
        <moz-message-bar
          type="warning"
          id="warning"
          message=""
        ></moz-message-bar>
      </div>
      <div id="content">
        <!-- local tab -->
        <div id="local-inference" class="tab active">
          <div class="fieldset-container">
            <fieldset>
              <legend>Inference Pad</legend>

              Predefined example:
              <select id="predefined"></select>
              <hr />
              <div class="form-container">
                <div>
                  Pick a Model Hub to use:
                  <span class="tooltip"
                    >ℹ️
                    <span class="tooltiptext">
                      If you want to use Hugging Face, start Firefox with
                      MOZ_ALLOW_EXTERNAL_ML_HUB=1
                    </span>
                  </span>

                  <select id="modelHub">
                    <option value="mozilla">Mozilla</option>
                    <option value="huggingface">Hugging Face</option>
                  </select>
                </div>

                <div>
                  <label for="taskName">Task:</label>
                  <select id="taskName"></select>
                </div>
                <div>
                  <label for="modelId">Model id:</label>
                  <span class="tooltip"
                    >ℹ️
                    <span class="tooltiptext">
                      The model needs to be compatible with Transformers.js
                    </span>
                  </span>

                  <input
                    type="text"
                    id="modelId"
                    value="mozilla/text_summarization"
                  />
                </div>
                <div>
                  <label for="modelRevision">Model Revision:</label>
                  <span class="tooltip"
                    >ℹ️
                    <span class="tooltiptext">
                      This is typically the branch of the model repository.
                    </span>
                  </span>

                  <input type="text" id="modelRevision" value="main" />
                </div>
                <div>
                  <label for="quantization">Quantization:</label>
                  <select id="dtype"></select>
                </div>
                <div>
                  <label for="device">Device:</label>
                  <select id="device">
                    <option value="cpu" selected>cpu</option>
                    <option value="gpu">gpu</option>
                  </select>
                </div>
                <div>
                  <label for="numRuns">Number of runs:</label>
                  <span class="tooltip"
                    >ℹ️
                    <span class="tooltiptext">Number of times to run</span>
                  </span>
                  <input id="numRuns" type="number" min="1" value="1" />
                </div>
                <div>
                  <label for="numThreads">Number of threads:</label>
                  <span class="tooltip"
                    >ℹ️
                    <span class="tooltiptext">1 means no multi-threading</span>
                  </span>
                  <select id="numThreads"></select>
                </div>
                <div>
                  <label for="backend">Backend:</label>
                  <select id="backend"></select>
                </div>
                <div>
                  <label for="timeout">Timeout:</label>
                  <input id="timeout" type="number" min="30" value="30" />
                </div>
                <div>
                  <label for="inferencePad">Input data:</label>
                  <span class="tooltip"
                    >ℹ️
                    <span class="tooltiptext">
                      Keep the JSON valid, with the provided keys.
                    </span>
                  </span>

                  <textarea id="inferencePad"></textarea>
                </div>
                <div>
                  <input
                    type="button"
                    id="inferenceButton"
                    value="Run Inference"
                  />
                </div>
              </div>
            </fieldset>

            <fieldset>
              <legend data-l10n-id="about-inference-processes-title"></legend>
              <div id="statusTableContainer"></div>
              <hr />
              <div id="procInfoTableContainer"></div>
              <h3>Downloads</h3>
              <div id="downloads"></div>
              <h3>Console</h3>
              <textarea readonly id="console"></textarea>
            </fieldset>
          </div>
        </div>

        <!-- model tab -->
        <div id="models-storage" class="tab" hidden="true">
          <model-files-view></model-files-view>
        </div>

        <!-- benchmark -->
        <div id="benchmark" class="tab" hidden="true">
          <div class="fieldset-container">
            <fieldset class="large">
              <legend data-l10n-id="about-inference-benchmark-title"></legend>
              <p data-l10n-id="about-inference-benchmark-description"></p>
              <div id="benchmark">
                <input
                  id="benchmark.button"
                  type="button"
                  data-l10n-id="about-inference-benchmark-button"
                  value="Run Benchmark"
                />
                <label for="benchmark.backend">Backend:</label>
                <select id="benchmark.backend"></select>
                <textarea id="benchmark.output" readonly></textarea>
              </div>
            </fieldset>
          </div>
        </div>
      </div>
    </div>
    <!-- end of content -->
  </body>
</html>