Skip to content

Commit

Permalink
Merge pull request #61 from NingW101/add-term-of-use
Browse files Browse the repository at this point in the history
Add terms of use page
  • Loading branch information
ibelem authored Oct 21, 2024
2 parents fb970ba + 385f0a3 commit 8c9f1f7
Show file tree
Hide file tree
Showing 20 changed files with 805 additions and 340 deletions.
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
</style>
</head>

<body class="background-gradient">
<body>
<div id="naviBar" class="sticky top-0 z-50"></div>
<div class="container mx-auto 2xl:my-8 w-full">
<div class="main-content container mx-auto my-2 2xl:my-8 w-full">
<section class="flex flex-col px-10 2xl:px-20">
<div>
<h1 class="text-shadow-sm">
Expand Down Expand Up @@ -119,6 +119,8 @@ <h1 class="text-shadow-sm">
</div>
</section>
</div>

<footer id="footer"></footer>
</body>
<script type="module" src="./js/main.js"></script>
</html>
3 changes: 2 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*-----------------------------------------------------------------------------------------------*/

import { setupNavigBar } from "./navbar.js";
import { setupNavigBar, setupFooter } from "./navigation.js";

// Used for release to public domain, so the project can be hosted on GitHub Pages or other static hosting services.
const baseUrl =
Expand Down Expand Up @@ -767,3 +767,4 @@ bindFilterChangeEventHandler();
changeFilterHandler();
setupVideos();
setupNavigBar(".");
setupFooter(".");
14 changes: 13 additions & 1 deletion js/navbar.js → js/navigation.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions samples/image_background_removal/background_removal.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { AutoModel, AutoProcessor, env, RawImage } from "@xenova/transformers";

import { setupNavigBar } from "../../js/navbar.js";
import { setupNavigBar, setupFooter } from "../../js/navigation.js";
import {
changeClass4StatusBar,
getRequestPrefix,
Expand All @@ -26,8 +26,9 @@ import {

import exampleImg from "/assets/person.avif";

// load navigation bar
// load navigation bar & footer
setupNavigBar("../..");
setupFooter("../..");

// Since we will download the model from the Hugging Face Hub, we can skip the local model check
env.allowLocalModels = VITE_ENV_USE_REMOTE_MODELS ? false : true;
Expand Down
4 changes: 3 additions & 1 deletion samples/image_background_removal/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<body>
<div id="naviBar" class="sticky top-0 z-50"></div>

<div class="container mx-auto w-full px-8 lg:px-20">
<div class="main-content container mx-auto w-full px-8 lg:px-20">
<div class="2xl:py-8 py-2">
<h1 class="text-shadow-sm">
<span
Expand Down Expand Up @@ -212,6 +212,8 @@ <h1 class="text-shadow-sm">
</div>
</div>
</div>

<footer id="footer"></footer>
</body>

<script type="module" src="./background_removal.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion samples/image_to_text/image_to_text.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*-----------------------------------------------------------------------------------------------*/

import { setupNavigBar } from "../../js/navbar.js";
import { setupNavigBar, setupFooter } from "../../js/navigation.js";
import {
changeClass4StatusBar,
defineResourcesObject,
Expand All @@ -23,6 +23,7 @@ import { ALL_NEEDED_MODEL_RESOURCES } from "../../config.js";
import Worker from "../common/worker.js?worker&inline";

setupNavigBar("../..");
setupFooter("../..");

const worker = new Worker();
const DEFAULT_CACHE_STORAGE_NAME = "transformers-cache";
Expand Down
4 changes: 3 additions & 1 deletion samples/image_to_text/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<body>
<div id="naviBar" class="sticky top-0 z-50"></div>

<div class="container mx-auto w-full px-8 lg:px-20">
<div class="main-content container mx-auto w-full px-8 lg:px-20">
<div class="2xl:py-8 py-2">
<h1 class="text-shadow-sm">
<span
Expand Down Expand Up @@ -312,6 +312,8 @@ <h1 class="text-shadow-sm">
</div>
</div>
</div>

<footer id="footer"></footer>
</body>

<script type="module" src="./image_to_text.js"></script>
Expand Down
6 changes: 4 additions & 2 deletions samples/llm_gemma/gemma.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
<body>
<div id="naviBar" class="sticky top-0 z-50"></div>

<div class="container mx-auto w-full px-8 lg:px-20">
<div class="2xl:py-8 py-2">
<div class="main-content container mx-auto my-8 w-full px-8 lg:px-20">
<div>
<h1 class="text-shadow-sm">
<span
class="font-sans block text-4xl font-extrabold 2xl:text-5xl text-stone-50 text-center"
Expand Down Expand Up @@ -372,6 +372,8 @@ <h3>
</div>
</div>
</div>

<footer id="footer"></footer>
</body>

<script type="module" src="gemma.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion samples/llm_gemma/gemma.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
removeHiddenClass,
formatBytes
} from "../common/utility.js";
import { setupNavigBar } from "../../js/navbar.js";
import { setupNavigBar, setupFooter } from "../../js/navigation.js";
import {
MEDIAPIPE_WASM_FILE_PATH,
ALL_NEEDED_MODEL_RESOURCES
Expand Down Expand Up @@ -258,3 +258,4 @@ document.getElementById("upload").addEventListener("change", function (event) {
});

setupNavigBar("../..");
setupFooter("../..");
43 changes: 43 additions & 0 deletions samples/phi3-webgpu/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,52 @@
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Phi-3 WebGPU</title>
<style>
.absolute_center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

body {
background: rgba(0, 7, 52, 1) url("/assets/bg.png") center / cover
no-repeat fixed;
overflow-x: hidden;
display: flex;
flex-direction: column;
min-height: 100vh;
}

.main-content {
flex: 1;
}

.divider {
width: 95%;
margin: 10px auto;
height: 1px;
background-color: rgba(255, 255, 255, 0.2);
}

footer {
padding: 0 10px 10px 10px;
margin: 0 auto;
text-align: center;
border-top: 1px solid transparent;
}
</style>
</head>
<body>
<div id="root"></div>
<div class="divider"></div>
<footer>
<a
href="../../terms.html"
class="text-stone-50/80 hover:text-stone-50 hover:underline hover:underline-offset-4 font-serif font-medium"
>Terms of Use</a
>
</footer>
<script type="module" src="./src/main.jsx"></script>
</body>
</html>
13 changes: 0 additions & 13 deletions samples/phi3-webgpu/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,4 @@
.overflow-wrap-anywhere {
overflow-wrap: anywhere;
}

.absolute_center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}

body {
background: rgba(0, 7, 52, 1) url("/assets/bg.png") center / cover no-repeat
fixed;
overflow-x: hidden;
}
}
4 changes: 3 additions & 1 deletion samples/question_answering/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<body>
<div id="naviBar" class="sticky top-0 z-50"></div>

<div class="container mx-auto w-full px-8 lg:px-20">
<div class="main-content container mx-auto w-full px-8 lg:px-20">
<div class="2xl:py-8 py-2">
<h1 class="text-shadow-sm">
<span
Expand Down Expand Up @@ -214,6 +214,8 @@ <h1 class="text-shadow-sm">
</div>
</section>
</div>

<footer id="footer"></footer>
</body>

<script type="module" src="./question_answering.js"></script>
Expand Down
3 changes: 2 additions & 1 deletion samples/question_answering/question_answering.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*-----------------------------------------------------------------------------------------------*/

import { setupNavigBar } from "../../js/navbar.js";
import { setupNavigBar, setupFooter } from "../../js/navigation.js";
import {
changeClass4StatusBar,
getElementId4Resource,
Expand All @@ -20,6 +20,7 @@ import Worker from "../common/worker.js?worker&inline";
import { ALL_NEEDED_MODEL_RESOURCES } from "../../config.js";

setupNavigBar("../..");
setupFooter("../..");

const worker = new Worker();

Expand Down
4 changes: 3 additions & 1 deletion samples/stable_diffusion/stable-diffusion.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<body>
<div id="naviBar" class="sticky top-0 z-50"></div>

<div class="container mx-auto my-8 w-full px-8 lg:px-20">
<div class="main-content container mx-auto my-8 w-full px-8 lg:px-20">
<div>
<h1 class="text-shadow-sm">
<span
Expand Down Expand Up @@ -536,6 +536,8 @@ <h1 class="text-shadow-sm">

<div id="status" style="font: 1em consolas"></div>
</div>

<footer id="footer"></footer>
</body>

<script type="module" src="./stable-diffusion.js"></script>
Expand Down
5 changes: 3 additions & 2 deletions samples/stable_diffusion/stable-diffusion.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/* eslint-disable no-unused-vars */

import { AutoTokenizer, env } from "@xenova/transformers";
import { setupNavigBar } from "../../js/navbar.js";
import { setupNavigBar, setupFooter } from "../../js/navigation.js";
import {
changeClass4StatusBar,
getRequestPrefix,
Expand All @@ -16,8 +16,9 @@ import {
} from "../common/utility.js";
import { ALL_NEEDED_MODEL_RESOURCES } from "../../config.js";

// load navigation bar
// load navigation bar & footer
setupNavigBar("../..");
setupFooter("../..");

if (VITE_ENV_USE_REMOTE_MODELS) {
env.allowLocalModels = false;
Expand Down
Loading

0 comments on commit 8c9f1f7

Please sign in to comment.