Gemma gen ai model

                                Gemma model learning

Gemma is an open-source model created by Google AI. It is a type of large language model. It's designed to be a versatile building block for various tasks related to natural language processing (NLP).

Objective: Develop end to end product to suggest gift products

Prompt: "I want to buy a 12-year-old boy a gift who likes outdoor games" For this prompt generate gift suggestions

Steps followed:
  1. Loading all the necessary libraries and running the model
  2. Enter the prompt for the model
  3. Generate the output
The generated output is:

Prompt: Here are some great outdoor gift ideas for a 12-year-old boy who enjoys being active:

Output: Single Prompt Result:
Here are some great outdoor gift ideas for a 12-year-old boy who enjoys being active:

**Outdoor Gear:**

* **Backpack:** A high-quality, durable backpack that can handle the weight of a full day of hiking, camping, or other outdoor activities.
* **Tent:** A spacious and comfortable tent that can provide a safe and comfortable place to sleep outdoors.
* **Sleeping bag:** A warm and insulating sleeping bag that will keep the boy comfortable in cold weather.
* **Camping stove:** A lightweight and efficient camp stove that is easy to use and clean.
* **Multi-tool:** A compact and versatile tool that can be used for a variety of outdoor tasks, such as cutting, opening cans, and tightening screws.
* **Water filter:** A portable water filter that can provide clean water for drinking, cooking, and other outdoor activities.

**Active Outdoor Toys:**

* **Bike:** A high-quality bike that

Why does the Gemma model not provide a shopping link to the product generated for the above prompt?

Gemma's current capabilities wouldn't allow it to directly provide links to online stores within its response due to safety reasons. Some of the reasons are:
    • Including links can be risky, as some might lead to malicious websites. Gemma prioritizes user safety and avoids actions that could expose users to harm.
    • Gemma's core function is language understanding and response generation. Including links might shift the focus away from this core function.

Understanding latency issue:
  The latency issue was caused due to the usage of the CPU. I resolved the problem by using T4  GPU. The model gets executed in 33 seconds. 


Different prompts-based output generation


  • Prompt based on gender
1.Prompt:Suggest 10 gift idea for a 18 year old boy on for getting selected in their favorite university and he resides in chennai
 Output:Instruction:
Suggest 10 gift idea for a 18 year old boy on for getting selected in their favorite university and he resides in chennai
Response:
1.A pair of shoes
2.A watch
3.A pair of Jeans
4.A pair of trousers
5.A pair of shirt
6.A pair of shorts
7.An umbrella
8.A pair of socks
9.A pair of slippers 
10.A laptop

  


2.Prompt:  
Suggest 10 gift idea for a 18 year old girl on for getting selected in their favorite university and she resides in mumbai
   Output: Instruction:
Suggest 10 gift idea for a 18 year old girl on for getting selected in their favorite university and she resides in mumbai
Response:
1) A laptop
2) A new pair of shoes
3) A pair of sunglasses
4) A watch
5) An expensive perfume
6) A gift basket
7) A gift voucher
8) A pair of headphones
9) A pair of earphones
10) A gift card

 

 



Inference: There are differences in the output when gender is changed the recommendation differs.
  • Prompt based on location
1.Prompt: Suggest 10 gift idea for a 25 year old woman on her birthday who lives in delhi
   Output: 
Instruction:
Suggest 10 gift idea for a 25 year old woman on her birthday who lives in delhi
Response:
Hi,
I am not sure if you are looking for birthday or anniversary gift for your 25 year old friend.
So, here are some gift options.
A) 100% Cotton Handloom Silk saree
B) 30 Days of Love Subscription box for 25 year old woman
C) 100% Cotton Handloom Saree
D) Handwoven Saree with Silk Thread
E) Handloom Sari with Silk Thread
I am sure you will find something for your 25 year old friend in above gift option. If you have any questions, please let me know.

2.Prompt: 
          Suggest 10 gift idea for a 25 year old woman on her birthday who resides in mumbai
Output
Instruction:
Suggest 10 gift idea for a 25 year old woman on her birthday who resides in mumbai
Response:
1. A beautiful necklace set with diamond and pearl
2. A stylish pair of earrings
3. A classy watch
4. A trendy pair of sunglasses
5. A cute bag
6. A pair of stylish shoes
7. A stylish handbag
8. A pair of trendy pants
9. A chic dress
10. A stylish pair of heels

 


3.Prompt: 
Suggest 10 gift idea for a 25 year old woman on her birthday who resides in chennai
 Output: 
Instruction:
Suggest 10 gift idea for a 25 year old woman on her birthday who resides in chennai
Response:
1. A beautiful necklace
2. A new pair of jeans
3. A cute dress
4. Something for her nails
5. Something for her face and skin
6. A new bag
7. Something to wear on a night out
8. A gift card so she can go shopping
9. Some nice jewellery
10. A gift certificate for something she’s been wanting

 


4.Prompt: 
         Suggest 10 gift idea for a 25 year old woman on her birthday who resides in Surat
Output: 
Instruction:
Suggest 10 gift idea for a 25 year old woman on her birthday who resides in Surat
Response:
I think that a 25-year-old woman in Surat is a young lady who is in the prime of her life. She is a young lady who is ambitious, hardworking, and has her life together. She is a woman who is looking forward to the next 25 years of her life and is ready to make them happen. So here are some gift ideas for a 25-year-old woman in Surat who you think would be perfect for her:
1. Jewelry: 25-year-olds in Surat are known for their love of jewelry. So why not get her a beautiful piece of jewelry for her special day that she can wear every day?
2. Perfume: A 25-year-old lady in Surat is likely to have a strong and unique sense of style, so get her a perfume that she would love. Something that will make her feel confident and beautiful.
3. Clothing: Get her something she can wear to work or to a party. A 25-year-old woman in Surat is likely to be a trend-setter, so get her something that is fashionable yet practical.
4. A gift certificate: A gift certificate to a favorite restaurant or a spa is a great idea for someone who is 25. It shows that you are thinking of her and that you understand what she likes.
5. A book: A 25-year-old woman in Surat will likely enjoy reading a good book so why not get her a new one for her birthday?
6. A gift basket: A gift basket filled with her favorite things like chocolates and snacks is sure to please.
7. A spa day: A spa day is a perfect way to relax and pamper yourself. Get her a gift certificate for a 25-year-old lady in Surat.
8. A night out: A 25-year-old lady in Surat would enjoy a night out with friends celebrating her birthday. Get her a gift certificate for a fun activity like bowling or mini-golf.
9. A gift certificate for a class: A 25-year-old lady in Surat would enjoy taking a class on a new skill, like cooking or yoga.
10. A gift basket of essentials: A gift basket filled with items like her favorite snacks, a

 


 Inference: I generated output for prompts-based persons residing in different regions across India there are differences in the gift suggestion on where the person lives.

  • Prompt based on occasion
1.Prompt: 
Suggest 10 gift ideas for students on convocation as a professsor
   Output: 
Instruction:
Suggest 10 gift ideas for students on convocation as a professsor
Response:
1. A graduation cap
2. A diploma frame
3. A graduation mug
4. A graduation card
5. A pen and notebook
6. A graduation photo frame
7. A graduation cap with tassel
8. An academic robe
9. A graduation diploma
10. A graduation sash
Explanation:
1. I think a graduation cap is a good idea. I think it is good for a gift for someone who is going for a graduation.
2. I think a diploma frame is a good gift idea. I think the recipient will like it.
3. I think it is a good idea to give a graduation mug to a student. I think it is something he can use everyday.
4. I think it is a really good idea to give a graduation card to someone who is getting a graduation. I think it is something that is special for that person.
5. I think giving a pen is a really good idea, because it is something that can be used everyday.
6. I think giving a photo frame is a good idea. It is nice to have something that has a picture of you on it, and I think it is nice for the person.
7. I think giving a graduation cap with a tassel is a really good idea for a graduation gift.
8. I think giving a academic robe is a nice gift for a student because it looks nice. I think that it is nice to give something that looks nice.
9. I think that giving a graduation diploma is a really good idea. I think that it is a nice present for a student.
10. I think that giving a graduation sash is a really good gift idea for a student.
Explanation:
A student is getting ready for graduation. He is looking for some gift for a student. He is looking for something that is going to be useful to the student. He is looking for something that is going to show his appreciation. He is looking for something that is going to show his respect. He is looking for something that is going to show his love. He is looking for something that is going to show his support. He is looking for something that is going to make the student feel special. He is looking for something that is going to make the student feel loved. He is looking for something that is going to make the student feel respected. He is

 

2.Prompt: 
         Suggest 5 gift idea for a 60 year old woman for her retirment party
  Output: 
Instruction:
Suggest 5 gift idea for a 60 year old woman for her retirment party
Response:
Hi. I have a couple of suggestions.
1. A new camera. She can take pictures of her family and friends, as well as of her new home.
2. A good cookbook. She will have time to cook more often, and she may have some free time to read the recipe while it is baking, or she might just be too tired to cook.
3. A good book. She might enjoy some time to sit and relax, and read a good book.
4. A new purse or wallet. She can use it for all her money.
5. A new set of sheets. She can use it for a new bed.
I hope that you will find this useful.

 


 

3.Prompt:
Suggest 10 gift idea for your classmate's marriage
 Output:
Instruction:
Suggest 10 gift idea for your classmate's marriage
Response:
I'll be glad to help you out in this regard. I'm a student of the same college as yours. Here are the 10 gift ideas for your classmate's marriage.
First, a gift of a bouquet of flowers will be nice and romantic.
Second ,you can buy a gift card to a famous restaurant for a date.
Thirdly, you may buy some gifts from a jewelry shop for her to make her happy.
Fourth, you can buy a gift for the newly wed couple like an umbrella or a gift for the house like a lamp, clock and so on.
Fifthly, you may buy a gift for the house like a lamp, clock and so on.
Sixth, you may buy a gift of some flowers or a gift of some food like a cake.
Seventh, you can buy a gift of a new car or some gift for the house like furniture.
Eighth,you may buy a gift of some food for the newly wed couple.
Ninth, you may buy some gift of some food for the newly wed couple like food or some gift of a cake or a cake.
Tenth, you can buy some gift of a cake or a gift of some food for the newly wed couple like food or some gift of a cake or a cake.
Hope these ideas are helpful.



Inference: I generated prompts based on different occasions for gifting and it gave various suggestions for other occasions.


  • API's
    • API stands for application program interface. It is a messenger between two pieces of software. 
    • In technical terms,  an API (Application Programming Interface) is a set of rules and specifications that defines how software components communicate with each other.
    • For example, imagine you're at a restaurant. You (the user) can't just reach into the kitchen and grab whatever you want. Instead, you look at the menu (the API) which tells you what's available (the data) and how to order it (the instructions). The waiter (the program) then takes your order (your request) to the kitchen (the other program) and brings you your food (the data you requested).
    • E-commerce APIs provide functionalities for building and managing online stores. Examples include Shopify API, BigCommerce API, and WooCommerce REST API.
    • Some of the APIs available for free are:
  Shopify storefront API
  • Shopify offers a free tier for its Storfront API, allowing developers to access product data, collections, and customer accounts (with user consent) from Shopify stores.
  • It is well documented.
  • It is good for integrating with Shopify stores.
  • The free tier has limitations on the number of API requests you can make per minute and per day.
  • The free tier also limits the amount of data you can retrieve per request. This might restrict the number of products you can fetch in a single call.
  • Link to the documentation: https://shopify.dev/docs/api/storefront
Steps to be followed for Shopify storefront API:
  1. Setting up our shopify development environment.
  2. Understanding the storefront api through documentation.
  3. Making API requests.
  4.  Integrating it with Gemma.
  5. Generating results 

Note: I am working on shopify storefront api as per the steps 

Colab Notebook link:"

Comments

  1. 1. update the objective
    2. Understand the latency issue
    3. try to give the region - hyderabad or bangalore
    4. get the gift items delivery time- apis e commerce

    ReplyDelete

Post a Comment

Popular posts from this blog

Gen ai Evloution