kristenq commited on
Commit
e592b0b
·
1 Parent(s): 5dbb619

Fix config

Browse files
Files changed (3) hide show
  1. README.md +10 -20
  2. index.html +2 -2
  3. myemoji-gemma-3-270m-it.task +3 -0
README.md CHANGED
@@ -1,20 +1,10 @@
1
- # Run a fine-tuned Gemma 3 270M model in the browser with MediaPipe LLM Inference API
2
-
3
- This app demonstrates how to generate emojis from a text input using a fine-tuned Gemma 3 270M model running directly in the browser. For this demo you'll just change one line of code to point to your MediaPipe Task model bundle.
4
-
5
- ## Run the demo
6
- 1. Download the app files in this directory and include your .task model bundle in the local app folder.
7
- 2. In the worker.js file, update the `modelPath` to point to the .task file.
8
- 3. Open terminal on your computer and navigate (`cd`) to the app folder.
9
- 4. Run `npx serve` to start the local server.
10
- 5. Open the provided `localhost` address in your browser to run the app.
11
-
12
- ## How it works
13
- This demo sets up a simple web server to host a frontend where users can enter a text prompt. This starts a generation process in a web worker to avoid blocking the main UI thread. The worker uses a bundled version of the MediaPipe Tasks GenAI package ([@mediapipe/tasks-genai](https://www.npmjs.com/package/@mediapipe/tasks-genai)) to generate a response from the model and send it back to the user.
14
-
15
- **Requirements:** Browser with [WebGPU support](https://caniuse.com/webgpu)
16
-
17
- ## Resources
18
- * [Notebook: Fine-tune Gemma 3 270M](https://github.com/google-gemini/gemma-cookbook/blob/main/Demos/Emoji-Gemma-on-Web/resources/Fine_tune_Gemma_3_270M_for_emoji_generation.ipynb)
19
- * [Notebook: Convert Gemma 3 270M for use with MediaPipe](https://github.com/google-gemini/gemma-cookbook/blob/main/Demos/Emoji-Gemma-on-Web/resources/Convert_Gemma_3_270M_to_LiteRT_for_MediaPipe_LLM_Inference_API.ipynb)
20
- * [MediaPipe LLM Inference Web documentation](https://ai.google.dev/edge/mediapipe/solutions/genai/llm_inference/web_js)
 
1
+ ---
2
+ title: Emoji Generator
3
+ emoji:
4
+ colorFrom: blue
5
+ colorTo: yellow
6
+ sdk: static
7
+ short_description: Translate text to emojis with Gemma 3 270M running on-device
8
+ ---
9
+
10
+ This demo runs a fine-tuned Gemma 3 270M model client-side using MediaPipe LLM Inference API. After the initial download, the model is cached by the browser, allowing for offline inference and instant loading and on future visits.
 
 
 
 
 
 
 
 
 
 
index.html CHANGED
@@ -40,8 +40,8 @@
40
  </div>
41
  </div>
42
  <div class="footer">
43
- <p>Powered by <a href="https://huggingface.co/google/gemma-3-270m-it">Gemma 3 270M</a> and <a href="https://ai.google.dev/edge/mediapipe/">MediaPipe</a></p>
44
- <a href="https://github.com/google-gemini/gemma-cookbook/tree/main/Demos/Emoji-Gemma-on-Web" target="_blank">View on GitHub<svg fill="none" xmlns="http://www.w3.org/2000/svg"
45
  viewBox="0 0 7 12">
46
  <path d="m.06 10.4.94.93L6.33 6 1 .67l-.94.94L4.45 6" fill="#327AC3" />
47
  </svg></a>
 
40
  </div>
41
  </div>
42
  <div class="footer">
43
+ <p>Powered by <a href="https://goo.gle/hf-gemma-3-270m-it">Gemma 3 270M</a> and <a href="https://ai.google.dev/edge/mediapipe/">MediaPipe</a></p>
44
+ <a href="https://goo.gle/emoji-gemma-cookbook" target="_blank">View on GitHub<svg fill="none" xmlns="http://www.w3.org/2000/svg"
45
  viewBox="0 0 7 12">
46
  <path d="m.06 10.4.94.93L6.33 6 1 .67l-.94.94L4.45 6" fill="#327AC3" />
47
  </svg></a>
myemoji-gemma-3-270m-it.task ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1df7985bc5ef447755836c8cfb4ff54d7249ffac27a64231a13b37ed4bc374a
3
+ size 284366083