Skip to content

Commit

Permalink
Satisfy the linter
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang Gu committed Oct 8, 2024
1 parent aba22ec commit 96b2e54
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 159 deletions.
62 changes: 33 additions & 29 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ let SAMPLES = [
id: "webgpu_whisper_large",
title: "Whisper Large V3 Turbo",
desc: "Automatic speech recognition (ASR) with OpenAI Whisper Large V3 Turbo",
sampleUrl: "https://huggingface.co/spaces/webml-community/whisper-large-v3-turbo-webgpu",
sampleUrl:
"https://huggingface.co/spaces/webml-community/whisper-large-v3-turbo-webgpu",
models: ["Encoder", "Decoder"],
tasks: "Automatic Speech Recognition",
webApis: [BACKENDS.WEBGPU],
Expand Down Expand Up @@ -490,40 +491,43 @@ function constructSampleHTML(samples) {
<div class="flex 2xl:font-medium rounded-2xl bg-fuchsia-600/60 px-2 text-stone-50 w-auto">${sample.tasks}</div>
${sample.models.length > 0
? ` ${sample.models
.map(
(model) =>
`<div class="flex 2xl:font-medium rounded-2xl bg-stone-600/80 px-2 text-stone-50 w-auto">${model}</div>`
)
.join("")}`
: ``
}
${
sample.models.length > 0
? ` ${sample.models
.map(
(model) =>
`<div class="flex 2xl:font-medium rounded-2xl bg-stone-600/80 px-2 text-stone-50 w-auto">${model}</div>`
)
.join("")}`
: ``
}
<div
class="flex 2xl:font-medium rounded-2xl bg-teal-600/80 px-2 text-stone-50">${sample.framework}
</div>
${sample.webApis.length > 0
? `
${
sample.webApis.length > 0
? `
${sample.webApis
.map(
(api) =>
`<div class="flex 2xl:font-medium rounded-2xl bg-indigo-600/80 px-2 text-stone-50">${api}</div>`
)
.join("")}`
: ``
}
${sample.devices.length > 0
? `${sample.devices
.map(
(device) =>
`<div class="flex 2xl:font-medium rounded-2xl bg-sky-600/80 px-2 text-stone-50">${device}</div>`
)
.join("")}`
: ``
}
.map(
(api) =>
`<div class="flex 2xl:font-medium rounded-2xl bg-indigo-600/80 px-2 text-stone-50">${api}</div>`
)
.join("")}`
: ``
}
${
sample.devices.length > 0
? `${sample.devices
.map(
(device) =>
`<div class="flex 2xl:font-medium rounded-2xl bg-sky-600/80 px-2 text-stone-50">${device}</div>`
)
.join("")}`
: ``
}
</div>
</div>
Expand Down
12 changes: 6 additions & 6 deletions samples/phi3-webgpu/postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
export default {
plugins: {
tailwindcss: {},
autoprefixer: {}
}
};
221 changes: 109 additions & 112 deletions samples/phi3-webgpu/src/components/Chat.css
Original file line number Diff line number Diff line change
@@ -1,112 +1,109 @@
@scope (.markdown) {

/* Code blocks */
pre {
margin: 0.5rem 0;
white-space: break-spaces;
}

code {
padding: 0.2em 0.4em;
border-radius: 4px;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
font-size: 0.9em;
}

pre,
code {
background-color: #f2f2f2;
}

@media (prefers-color-scheme: dark) {

pre,
code {
background-color: #333;
}

}

pre:has(code) {
padding: 1rem 0.5rem;
}

pre>code {
padding: 0;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 600;
line-height: 1.2;
}

h1 {
font-size: 2em;
margin: 1rem 0;
}

h2 {
font-size: 1.5em;
margin: 0.83rem 0;
}

h3 {
font-size: 1.25em;
margin: 0.67rem 0;
}

h4 {
font-size: 1em;
margin: 0.5rem 0;
}

h5 {
font-size: 0.875em;
margin: 0.33rem 0;
}

h6 {
font-size: 0.75em;
margin: 0.25rem 0;
}

h1,
h2,
h3,
h4,
h5,
h6:first-child {
margin-top: 0;
}

/* Unordered List */
ul {
list-style-type: disc;
margin-left: 1.5rem;
}

/* Ordered List */
ol {
list-style-type: decimal;
margin-left: 1.5rem;
}

/* List Items */
li {
margin: 0.25rem 0;
}

p:not(:first-child) {
margin-top: 0.75rem;
}

p:not(:last-child) {
margin-bottom: 0.75rem;
}
}
@scope (.markdown) {
/* Code blocks */
pre {
margin: 0.5rem 0;
white-space: break-spaces;
}

code {
padding: 0.2em 0.4em;
border-radius: 4px;
font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
font-size: 0.9em;
}

pre,
code {
background-color: #f2f2f2;
}

@media (prefers-color-scheme: dark) {
pre,
code {
background-color: #333;
}
}

pre:has(code) {
padding: 1rem 0.5rem;
}

pre > code {
padding: 0;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: 600;
line-height: 1.2;
}

h1 {
font-size: 2em;
margin: 1rem 0;
}

h2 {
font-size: 1.5em;
margin: 0.83rem 0;
}

h3 {
font-size: 1.25em;
margin: 0.67rem 0;
}

h4 {
font-size: 1em;
margin: 0.5rem 0;
}

h5 {
font-size: 0.875em;
margin: 0.33rem 0;
}

h6 {
font-size: 0.75em;
margin: 0.25rem 0;
}

h1,
h2,
h3,
h4,
h5,
h6:first-child {
margin-top: 0;
}

/* Unordered List */
ul {
list-style-type: disc;
margin-left: 1.5rem;
}

/* Ordered List */
ol {
list-style-type: decimal;
margin-left: 1.5rem;
}

/* List Items */
li {
margin: 0.25rem 0;
}

p:not(:first-child) {
margin-top: 0.75rem;
}

p:not(:last-child) {
margin-bottom: 0.75rem;
}
}
20 changes: 8 additions & 12 deletions samples/phi3-webgpu/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
/** @type {import('tailwindcss').Config} */
export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {},
},
plugins: [],
}

/** @type {import('tailwindcss').Config} */
export default {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {}
},
plugins: []
};

0 comments on commit 96b2e54

Please sign in to comment.