♊️ GemiNews 🗞️
(dev)
🏡
📰 Articles
🏷️ Tags
🧠 Queries
📈 Graphs
☁️ Stats
💁🏻 Assistant
💬
🎙️
Demo 1: Embeddings + Recommendation
Demo 2: Bella RAGa
Demo 3: NewRetriever
Demo 4: Assistant function calling
Editing article
Title
Summary
Content
<p>As a rubyist, I love gems.</p><p>So imagine my delight and surprise when last week <a href="https://blog.google/technology/developers/gemma-open-models/">Google announced <strong>Gemma</strong></a>, a family of open models available directly on `Kaggle`: <a href="https://www.kaggle.com/models/google/gemma">google/gemma</a>. Plus, it’s <em>free</em>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*zktJLAqzgGa4ISoynpyMSQ.jpeg" /><figcaption>Gemma is born!</figcaption></figure><h4>But I know nothing about ML and Kaggle!</h4><p>If you’re like me, a CLI kind of person, fear no more! I found a way to call Gemma with cURL (<a href="https://www.youtube.com/watch?v=1ZXHsNqkDI4">“if you can curl it, you can call it in any language!”</a> — said a wise man in Dodgeball — did he?).</p><p>Don’t believe me? Check out my ugly bash code here: <a href="https://github.com/palladius/genai-googlecloud-scripts/tree/main/10-gemma-is-born">https://github.com/palladius/genai-googlecloud-scripts/tree/main/10-gemma-is-born</a>/</p><h4>How do I install Gemma locally?</h4><p>I haven’t tried that one out, I’m sorry. It’s in my todo list.</p><h4>How do I install Gemma in the Cloud?</h4><p>As Barney would say <em>“Glad you asked!”. </em>I got hooked by <a href="https://www.youtube.com/watch?v=BM3wzKSPOoI">this great video</a> by Mark Ryan which got me started.</p><p>Please note that in this case you need <a href="https://cloud.google.com/docs/get-started">access to Google Cloud</a> and have billing enabled. You need:<br>1. A Gmail account (Google Account)<br>2. A Google Cloud Project with <a href="https://cloud.google.com/billing/docs/how-to/modify-project">billing enabled</a>.</p><p>If this doesn’t scare you off, the easiest way is to:</p><ol><li>Click on <a href="https://www.kaggle.com/models/google/gemma">https://www.kaggle.com/models/google/gemma</a></li><li>Click on <a href="https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/335">Gemma on Vertex Model Garden</a> in that page.</li><li>Follow instructions.</li></ol><p>Once done, you should have something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jucMU_v822feb70TLKSDBw.png" /><figcaption>Gemma has been installed</figcaption></figure><h4>Ok, so what now? How do I interact with Gemma?</h4><p>Glad you asked!</p><ul><li>Click on the model (blue line above).</li><li>Under “Deploy and Test” tab you should see an awesome “Test your model ”. It accepts a JSON.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qGEh59zcn_abB4XBA9Ossg.png" /></figure><p>It took me one hour of digging but I can tell you, the JSON can be as simple as this:</p><pre>{<br> "instances": [{<br> "prompt": "What's the difference between a city bike and a racing bike?",<br> "max_tokens": 1000<br> }]<br>}</pre><p>The output will look like this:</p><pre>{<br> "predictions": [<br> ".. GEMMA_ANSWER_HERE ..."<br> ],<br> "deployedModelId": "6852805176160419840",<br> "model": "projects/980606839737/locations/us-central1/models/google_gemma-7b-it-1708849093570",<br> "modelDisplayName": "google_gemma-7b-it-1708849093570",<br> "modelVersionId": "1"<br>}</pre><p>So writing a shell wrapper is as easy as cURLplus ajq(latest code <a href="https://github.com/palladius/genai-googlecloud-scripts/blob/main/10-gemma-is-born/gemma-hello.sh">here</a>):</p><pre># You just change these to your model_id and your project_id<br>ENDPOINT_ID="6294864597715255296"<br>PROJECT_NUMBER="980606839737"<br># this contains the question<br>INPUT_DATA_FILE="gemma-input-hello.json"<br># this contains the answer (not really needed but good for training purposes)<br>OUTPUT_DATA_FILE="gemma-output-hello.json"<br><br>curl \<br> -X POST \<br> -H "Authorization: Bearer $(gcloud auth print-access-token)" \<br> -H "Content-Type: application/json" \<br> https://us-central1-aiplatform.googleapis.com/v1/projects/${PROJECT_NUMBER}/locations/us-central1/endpoints/${ENDPOINT_ID}:predict \<br> -d "@${INPUT_DATA_FILE}" | tee "$OUTPUT_DATA_FILE"<br><br>PREDICTION=$(cat "$OUTPUT_DATA_FILE" | jq .predictions[0])<br><br>echo -en "$PREDICTION\n"</pre><h4>Conclusions</h4><p>Deploying Gemma to Vertex AI and calling the model via curl is a <em>breeze</em>.</p><p>And you, what are you waiting for?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5ea9ba576ec" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/gemma-is-born-c5ea9ba576ec">Gemma is born!</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>
Author
Link
Published date
Image url
Feed url
Guid
Hidden blurb
--- !ruby/object:Feedjira::Parser::RSSEntry title: Gemma is born! url: https://medium.com/google-cloud/gemma-is-born-c5ea9ba576ec?source=rss-b5293b96912f------2 author: Riccardo Carlesso categories: - machine-learning - gemma - google-cloud-platform - curl - vertex-ai published: 2024-02-26 16:23:09.000000000 Z entry_id: !ruby/object:Feedjira::Parser::GloballyUniqueIdentifier is_perma_link: 'false' guid: https://medium.com/p/c5ea9ba576ec carlessian_info: news_filer_version: 2 newspaper: Riccardo Carlesso - Medium macro_region: Blogs rss_fields: - title - url - author - categories - published - entry_id - content content: '<p>As a rubyist, I love gems.</p><p>So imagine my delight and surprise when last week <a href="https://blog.google/technology/developers/gemma-open-models/">Google announced <strong>Gemma</strong></a>, a family of open models available directly on `Kaggle`: <a href="https://www.kaggle.com/models/google/gemma">google/gemma</a>. Plus, it’s <em>free</em>!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*zktJLAqzgGa4ISoynpyMSQ.jpeg" /><figcaption>Gemma is born!</figcaption></figure><h4>But I know nothing about ML and Kaggle!</h4><p>If you’re like me, a CLI kind of person, fear no more! I found a way to call Gemma with cURL (<a href="https://www.youtube.com/watch?v=1ZXHsNqkDI4">“if you can curl it, you can call it in any language!”</a> — said a wise man in Dodgeball — did he?).</p><p>Don’t believe me? Check out my ugly bash code here: <a href="https://github.com/palladius/genai-googlecloud-scripts/tree/main/10-gemma-is-born">https://github.com/palladius/genai-googlecloud-scripts/tree/main/10-gemma-is-born</a>/</p><h4>How do I install Gemma locally?</h4><p>I haven’t tried that one out, I’m sorry. It’s in my todo list.</p><h4>How do I install Gemma in the Cloud?</h4><p>As Barney would say <em>“Glad you asked!”. </em>I got hooked by <a href="https://www.youtube.com/watch?v=BM3wzKSPOoI">this great video</a> by Mark Ryan which got me started.</p><p>Please note that in this case you need <a href="https://cloud.google.com/docs/get-started">access to Google Cloud</a> and have billing enabled. You need:<br>1. A Gmail account (Google Account)<br>2. A Google Cloud Project with <a href="https://cloud.google.com/billing/docs/how-to/modify-project">billing enabled</a>.</p><p>If this doesn’t scare you off, the easiest way is to:</p><ol><li>Click on <a href="https://www.kaggle.com/models/google/gemma">https://www.kaggle.com/models/google/gemma</a></li><li>Click on <a href="https://console.cloud.google.com/vertex-ai/publishers/google/model-garden/335">Gemma on Vertex Model Garden</a> in that page.</li><li>Follow instructions.</li></ol><p>Once done, you should have something like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jucMU_v822feb70TLKSDBw.png" /><figcaption>Gemma has been installed</figcaption></figure><h4>Ok, so what now? How do I interact with Gemma?</h4><p>Glad you asked!</p><ul><li>Click on the model (blue line above).</li><li>Under “Deploy and Test” tab you should see an awesome “Test your model ”. It accepts a JSON.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qGEh59zcn_abB4XBA9Ossg.png" /></figure><p>It took me one hour of digging but I can tell you, the JSON can be as simple as this:</p><pre>{<br> "instances": [{<br> "prompt": "What's the difference between a city bike and a racing bike?",<br> "max_tokens": 1000<br> }]<br>}</pre><p>The output will look like this:</p><pre>{<br> "predictions": [<br> ".. GEMMA_ANSWER_HERE ..."<br> ],<br> "deployedModelId": "6852805176160419840",<br> "model": "projects/980606839737/locations/us-central1/models/google_gemma-7b-it-1708849093570",<br> "modelDisplayName": "google_gemma-7b-it-1708849093570",<br> "modelVersionId": "1"<br>}</pre><p>So writing a shell wrapper is as easy as cURLplus ajq(latest code <a href="https://github.com/palladius/genai-googlecloud-scripts/blob/main/10-gemma-is-born/gemma-hello.sh">here</a>):</p><pre># You just change these to your model_id and your project_id<br>ENDPOINT_ID="6294864597715255296"<br>PROJECT_NUMBER="980606839737"<br># this contains the question<br>INPUT_DATA_FILE="gemma-input-hello.json"<br># this contains the answer (not really needed but good for training purposes)<br>OUTPUT_DATA_FILE="gemma-output-hello.json"<br><br>curl \<br> -X POST \<br> -H "Authorization: Bearer $(gcloud auth print-access-token)" \<br> -H "Content-Type: application/json" \<br> https://us-central1-aiplatform.googleapis.com/v1/projects/${PROJECT_NUMBER}/locations/us-central1/endpoints/${ENDPOINT_ID}:predict \<br> -d "@${INPUT_DATA_FILE}" | tee "$OUTPUT_DATA_FILE"<br><br>PREDICTION=$(cat "$OUTPUT_DATA_FILE" | jq .predictions[0])<br><br>echo -en "$PREDICTION\n"</pre><h4>Conclusions</h4><p>Deploying Gemma to Vertex AI and calling the model via curl is a <em>breeze</em>.</p><p>And you, what are you waiting for?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5ea9ba576ec" width="1" height="1" alt=""><hr><p><a href="https://medium.com/google-cloud/gemma-is-born-c5ea9ba576ec">Gemma is born!</a> was originally published in <a href="https://medium.com/google-cloud">Google Cloud - Community</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>'
Language
Active
Ricc internal notes
Imported via /Users/ricc/git/gemini-news-crawler/webapp/db/seeds.d/import-feedjira.rb on 2024-03-31 11:22:23 +0200. Content is EMPTY here. Entried: title,url,author,categories,published,entry_id,content. TODO add Newspaper: filename = /Users/ricc/git/gemini-news-crawler/webapp/db/seeds.d/../../../crawler/out/feedjira/Blogs/Riccardo Carlesso - Medium/2024-02-26-Gemma_is_born!-v2.yaml
Ricc source
Show this article
Back to articles