Spaces:
Runtime error
Runtime error
File size: 15,764 Bytes
02c9934 6fec903 02c9934 1b7118b 850a15b 1b7118b 850a15b 1b7118b 850a15b 45c63a2 850a15b 45c63a2 850a15b 45c63a2 850a15b 45c63a2 850a15b 45c63a2 850a15b 45c63a2 850a15b 45c63a2 850a15b 45c63a2 850a15b 45c63a2 850a15b 45c63a2 850a15b 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 45c63a2 913dda7 81d76b1 5bfd400 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
from fastapi import FastAPI
from transformers import pipeline
# NOTE - we configure docs_url to serve the interactive Docs at the root path
# of the app. This way, we can use the docs as a landing page for the app on Spaces.
app = FastAPI(docs_url="/")
@app.get("/food")
def food_endpoint(breed: str):
"""
Using the text2text-generation pipeline from `transformers`, generate text
from the given input text. The model used is `google/flan-t5-small`, which
can be found [here](https://huggingface.co/google/flan-t5-small).
"""
if breed == 'Australian Shepherd':
return "1. For active Australian Shepherds, opt for dog food labeled for active breeds with higher protein, fat, and calories. 2. Prioritize quality animal-based protein for digestibility and essential amino acids. 3. Ensure moderate-to-high fat content to sustain your active Aussie's energy. 4. Include nutritious carbs like whole grains, veggies, and fruits for overall health and endurance."
elif breed == 'Basset Hound':
return "1. Prevent obesity: Opt for low-calorie dog food to maintain a healthy weight in Basset Hounds. 2. Support joints: Choose food with glucosamine and chondroitin for joint health. 3. Aid digestion: Pick easily digestible ingredients for a comfortable digestive system. 4. Tailor nutrition: Prioritize breed-specific diets for Basset Hounds' unique needs."
elif breed == 'Bernedoodles':
return "1. Opt for dog food with real meat as the main ingredient to provide essential nutrients. 2. Prioritize high-quality dog food rich in animal protein to support your Bernedoodle's energetic nature. 3. Ensure the inclusion of healthy fats, particularly omega-3 and omega-6 fatty acids, for their coat and overall well-being. 4. Select a formula that suits your Bernedoodle's life stage as their nutritional needs change with age."
elif breed == 'Bichon Frise':
return "1. Opt for limited ingredient dog food with novel proteins (fish, venison, duck, rabbit) for Bichons prone to allergies. 2. Ensure constant access to fresh water to prevent urolithiasis in your Bichon. 3. Be vigilant for allergy signs (skin irritation, digestive issues) and adjust their diet accordingly. 4. Regular vet check-ups help create a personalized diet plan to keep your Bichon healthy and allergy-free."
elif breed == 'Boston Terrier':
return "1. Enhance joint health with glucosamine and chondroitin being included in the diet. 2. Opt for animal-based proteins like chicken, turkey, or fish for muscle strength. 3. Be mindful of potential allergies in Boston Terriers and adjust the diet according to that. 4. Ensure a well-rounded diet to promote their overall health and well-being. Avoid diet containing more proportion of fillers."
elif breed == 'Boxer':
return "1. Opt for dog food rich in meat (like chicken, beef, or fish) to meet Boxers' protein requirements for their active lifestyle. 2. Steer clear of plant-based proteins as Boxers thrive on animal-derived protein sources. 3. Ensure your Boxer's weight is in check to prevent health issues; choose a formula that supports healthy weight management. 4. Approach grain-free options with care as some Boxers may be prone to taurine-related heart issues; consult a vet for dietary guidance."
elif breed == 'Boykin Spaniel':
return "1. For active Boykin Spaniels, pick food matching energy needs to prevent weight issues. 2. Prioritize balanced nutrition with proteins, fats, carbs, vitamins, and minerals. 3. Opt for animal-based proteins (chicken, beef, fish) for muscle health. 4. Choose quality ingredients, avoid fillers and artificial additives."
elif breed == 'Cairn Terrier':
return "1. Control calories: Choose proper food portions for your Cairn Terrier to maintain a healthy weight. 2. Omega-3 for coat: Feed fish oil or flaxseed for better skin and coat health. 3. Balanced diet: Ensure their food meets energy needs and provides essential nutrients. 4. Exercise: Keep them active for physical and mental well-being with ample amount of exercise."
elif breed == 'Cane Corso':
return "1. Since Cane Corsos have High-energy, larger size, watch portion sizes to avoid obesity. 2. Protein: Include 25-30% of protein for muscle health and active lifestyle. 3. Fat: 10-15% should be included for obtaining energy without excess calories. 4. Carbohydrates: Opt for whole grains or veggies to acquire nutrients and for better digestion to be included in the diet."
elif breed == 'Catahoula Leopards':
return "1. Pick medium-large breed dog food containing high protein for energy, taurine & vitamin A for eyes . 2. Choose quality animal proteins (chicken, beef, fish) for vitality and to fulfill protein requirement. 3. Bone health with balanced calcium/phosphorus and glucosamine/chondroitin. 4. Balanced nutrition for overall well-being of your pet should be considered."
elif breed == 'Chihuahua':
return "1. Puppies, adults, and seniors have unique nutritional requirements for their long-term health. 2. Chihuahua puppies require 1.0% arginine to support their rapid growth and development. 3. Adult Chihuahuas thrive on dog food with 0.51% arginine and a well-balanced combination of protein and calories. 4. Senior Chihuahuas benefit from dog food options that offer increased protein content and fewer calories."
elif breed == 'Corgi':
return "1. To ensure optimal health, make real animal-based proteins a dietary priority. 2. When selecting kibble, consider mouth size, ensuring it's comfortable for them to chew and digest their meals effectively. 3. Manage calorie intake and portion sizes to maintain their healthy weight and preventing overfeeding. 4. Enhance well-being by choosing dog food with added glucosamine and chondroitin for joint support."
elif breed == 'Dachshund':
return "1. Match Dachshund's food to their life stage (puppy, adult, or senior) for optimal nutrition. 2. Growing Dachshund puppies require 0.71% isoleucine and balanced nutrients. 3. Adult Dachshunds need 0.38% isoleucine and appropriate protein and calories. 4. Senior Dachshunds benefit from 50% more protein tailored to their age-specific needs. Choose the right nutrients!"
elif breed == 'Doberman Pinscher':
return "1. Prioritize joint health: Choose food with glucosamine and chondroitin for Doberman's hip health. 2. Opt for digestible ingredients: Pick foods with easily digestible components. 3. Avoid fillers and additives: Skip foods with excessive fillers and artificial additives. 4. Emphasize animal-based proteins: Go for high-quality animal-based proteins like chicken, turkey, or fish."
elif breed == 'French Bulldog':
return "1. Prioritize quality protein (chicken, beef, fish) over fillers (corn, soy, wheat) for a healthy French Bulldog diet. 2. Control weight with low-fat food in order to combat obesity and better manage weight. 3. Opt for omega-3 enriched food for better skin, coat, and joint health. 4. Pick small kibble to prevent choking and ease mealtime for your French Bulldog."
elif breed == 'German Shepherd':
return "1. Choose dog food with real meat (like chicken, beef, or fish) as the primary ingredient to ensure essential protein. 2. Opt for dog food containing glucosamine and chondroitin to support joint health, since they are prone to hip and joint issues. 3. Seek dog food with omega-3 fatty acids, often found in fish oil, to promote a healthy coat and skin. 4. Avoid dog foods that contain excessive fillers such as corn, soy, and wheat."
elif breed == 'Golden Retriever':
return "1. Consider your golden retriever's age when selecting their food. While adults thrive on quality brands, puppies face a higher due to a diet with excessive calcium. 2. A diet tailored for large breed puppies to reduce the risk of hip disease. 3. Avoid early switches and refrain from transitioning your golden retriever puppy to an adult dog food too soon. 4. Make informed choices to ensure they have the best chance for a healthy, happy life."
elif breed == 'Goldendoodle':
return "1. Goldendoodle puppies, adults, and seniors have distinct dietary requirements. Provide a diet that aligns with their specific life stages. 2. Goldendoodle puppies are at risk of developing hip disease if they consume excessive calcium during growth. 3. Adult goldendoodles need moderate calcium levels and an appropriate balance of protein and calories. 4. Senior goldendoodles benefit from diets with increased protein content."
elif breed == 'Havanese':
return "1. Havanese dogs are prone to obesity, so choose a dog food that meets their energy needs without excessive calories. 2. Due to their susceptibility to joint issues, look for dog food containing glucosamine and chondroitin. 3. Opt for dog food with high-quality animal-based proteins as the main ingredients, such as chicken, turkey, or fish. 4. Strive for a balanced diet that meets their specific needs, considering their weight management, joint health, and protein sources."
elif breed == 'Jack Russels':
return "1. Ensure your Jack Russell Terrier's food matches its age, whether it's a puppy, adult, or a senior dog. 2. Opt for foods rich in animal-based proteins like chicken, turkey, or fish which provide essential nutrients. 3. Choose dog foods that minimize plant-based protein sources in their ingredients. While, animal-based proteins are crucial 4. Look for recipes with omega-3 fatty acids from sources like fish oil or flaxseed. These fats promote a healthy coat."
elif breed == 'Labradoodle':
return "1. Opt for dog food with main ingredients like chicken, beef, or fish to provide essential amino acids. 2. Choose easily digestible dog food to minimize the risk of digestive issues and promote overall well-being. 3. Look for formulas containing carbohydrates like sweet potatoes or brown rice to provide a steady source of energy. 4. Labradoodles often have curly coats, so select dog food with omega-3 fatty acids from sources like fish oil or flaxseed."
elif breed == 'Labrador Retrievers':
return "1. Due to their large breed size, Puppies face a higher risk of hip disease if exposed to excessive calcium. 2. Adult Labs don't face the same risk related to breed size. However, it's important to provide them with balanced nutrition for their stage of life. 3. For Lab puppies, avoiding an excess of calcium is paramount, preventing the potential development of a permanent form of hip disease. 4. Consider the specific dietary needs throughout their life stages contributes. "
elif breed == 'Maltese':
return "1. Maltese dogs require a well-rounded diet with approximately 18-30% protein content to maintain lean muscle mass. 2. Providing a moderate amount of healthy fats (around 8-20% of their diet) is important. These fats play a key role in maintaining skin and coat health. 3. Due to their small size and tendency to gain weight easily, they require careful portion control. 4. Focus on a balanced diet that considers their protein and fat needs."
elif breed == 'Miniature Schnauzer':
return "1. Opt for kibble with a smaller size that suits their smaller mouths. Prioritize a well-balanced mix of nutrients. 2. Look for dog foods that list high-quality animal-based proteins like chicken, turkey, or fish as their main ingredients. 3. They can be prone to weight gain, so select a dog food formulated to help them maintain a healthy body weight. 4. Miniature Schnauzers are known to have dental issues, so choose a dog food that supports their dental health."
elif breed == 'Pitbull':
return "1. Aim for dog foods containing at least 20-30% protein, with high-quality sources like chicken, beef, or fish listed as the first ingredient. 2. To provide energy and support skin and coat health, include a moderate amount of healthy fats in their diet, typically around 10-20%. 3. Steer clear of dog foods that use fillers such as corn, wheat, and soy. These ingredients provide little nutritional value. 4. Create a diet plan tailored to your Pitbull's specific requirements."
elif breed == 'Pomeranian':
return "1. Choose dog food with real meat as the first ingredient, such as chicken, turkey, or lamb. 2. Pomeranians thrive on a diet rich in high-quality protein, and real meat sources provide the essential amino acids they need for muscle maintenance and overall health. 3. Prioritize healthy fats like chicken fat or fish oil in your Pomeranian's diet to support their energy levels and maintain a shiny coat. 4. Opt for small-sized kibbles if you're feeding your Pomeranian dry food."
elif breed == 'Rottweiler':
return "1. Opt for dog foods with high-quality animal protein sources like chicken, beef, or fish listed at the top of the ingredient list. 2. Healthy fats to maintain optimal skin and coat health. Look for dog foods with omega-3 and omega-6 fatty acids. 3. Steer clear of dog foods containing artificial colors, flavors, or preservatives. 4. It's essential to consult with your veterinarian to select the best diet for your Rottweiler."
elif breed == 'Shiba Inu':
return "1. Prioritize options that feature real animal-based protein sources as the primary ingredients. 2. Opt for choices that include proteins like chicken, beef, fish, or lamb, as these are excellent sources of essential nutrients for your Shiba's health and vitality. 3. Considering the small to medium size of Shiba Inus, smaller kibble is easier for them to chew and digest. 4. Look for dog food that includes sources of omega-3 fatty acids, such as fish oil or flaxseed."
elif breed == 'Siberian Husky':
return "1. The nutritional needs of huskies vary with their age. For adult huskies, a well-balanced is generally sufficient. 2. Husky puppies have a 2.2% higher risk of developing a permanent form of hip disease. 3. Feeding them a diet with excessive calcium content during their growth phase can exacerbate this risk. 4. Senior huskies generally need a diet with higher protein content and fewer calories compared to younger huskies."
elif breed == 'Weimaraners':
return "1. Select a dog food with the right balance of calcium and phosphorus to promote healthy bone development. 2. Seek dog food recipes that include glucosamine and chondroitin to support joint health. 3. Avoid strenuous exercise for at least an hour before and after meals. 4. Opt for formulations designed for large-sized breeds with high energy levels and exercise requirements."
elif breed == 'Vizsla':
return "1. Vizslas are predisposed to skeletal issues so choose dog foods that include glucosamine and chondroitin. 2. Opt for dog food with moderate levels of omega-3 and omega-6 fatty acids. 3. Vizslas thrive on a diet rich in high-quality animal protein sources such as chicken, beef, or fish. 4. Aim for a dog food formula that offers a well-balanced nutrient profile, combining the mentioned components and avoiding excessive fillers or additives."
elif breed == 'Yorkie':
return "1. The best food for a Yorkie depends on their age and life stage. For puppies, choose a dog food with a higher leucine content, around 1.29%. 2. Adult Yorkies require a lower leucine content, approximately 0.68%, to maintain their health and prevent excessive calorie intake. 3. Higher protein and calorie content in puppy food can be detrimental for less active older dogs. 4. Senior Yorkies benefit from dog food with increased protein content and fewer calories."
else:
return "Nutritional info currently not available for your breed. Will be updated soon!" |