Spaces:
Sleeping
Sleeping
LearnwithShashank commited on
Commit ·
3c7718e
1
Parent(s): e111e0b
Files changed (2)
- app.py+37-14
- requirements.txt+2-1
12124345667878101112131415910111213141516171819202122231718242526272829303132333435363738394041import gradio as grfrom transformers import pipelineimport streamlit as st
pipeline = pipeline(task="image-classification", model="julien-c/hotdog-not-hotdog")st.set_page_config(page_title="Gen Z vs Millennial Quiz", page_icon="🤖", layout="centered")st.title("✨ How Gen Z / Millennial Are You?")st.markdown("Answer these fun questions to find out your vibe!")
def predict(input_img): predictions = pipeline(input_img) return input_img, {p["label"]: p["score"] for p in predictions} score = 0
gradio_app = gr.Interface( predict, inputs=gr.Image(label="Select hot dog candidate", sources=['upload', 'webcam'], type="pil"), outputs=[gr.Image(label="Processed Image"), gr.Label(label="Result", num_top_classes=2)], title="Hot Dog? Or Not?",)questions = [ ("What’s your go-to way of laughing online?", ["😂", "💀", "Lmao / lol", "Voice note of laughing"], [1, 2, 1, 2]), ("Your reaction to a missed call:", ["Panic & text", "Call back", "Wait 2 days", "Block them"], [1, 2, 2, 3]), ("How do you take selfies?", ["Front camera only", "Tripod", "Don’t take selfies", "Snapchat filters"], [1, 2, 1, 3]), ("Phone at 1% battery:", ["Plug in", "Accept fate", "Low power mode", "Cry"], [1, 2, 1, 2]), ("Which of these do you still use?", ["Facebook", "Instagram", "TikTok", "Email only"], [0, 1, 2, 1]), ("Ideal vacation:", ["Solo trip", "Food tour", "Photoshoot", "Stay at home"], [1, 2, 2, 0]), ("Favorite texting style:", ["all lowercase", "With punctuation", "No punc", "ALL CAPS"], [2, 1, 1, 2]), ("2000s song plays:", ["Cry a little", "Sing loudly", "Post it", "Ask what song?"], [1, 1, 2, 0]), ("Choose your cringe:", ["TikToks", "LinkedIn posts", "WhatsApp forwards", "Old FB posts"], [2, 1, 0, 1]), ("Current wallpaper:", ["My pet", "A quote", "Black screen", "Celebrity crush"], [1, 1, 2, 2]), ("Group chat vibe:", ["Silent", "Memes", "Venting", "Voice notes"], [0, 2, 1, 2]), ("Most like you:", ["Adulting is hard", "Main character energy", "Vibe check failed", "Nap and snack"], [1, 2, 2, 2])]
if __name__ == "__main__": gradio_app.launch()for i, (q, opts, points) in enumerate(questions): st.subheader(f"Q{i+1}. {q}") choice = st.radio("", opts, key=i) score += points[opts.index(choice)]
if st.button("🔍 Reveal My Result"): st.markdown("---") if score >= 22: st.success("🎉 You're Pure Gen Z! 💅 You speak in memes, fear nothing, and run on iced coffee.") elif 14 <= score < 22: st.info("😎 You’re a Chill Millennial-Z Hybrid! You love both avocado toast and TikToks.") else: st.warning("📞 You’re More Millennial Vibes – Emo songs, Facebook memories, and semi-adulting life.")
st.markdown("Share your result:") share_text = "I just took the Gen Z vs Millennial quiz! Find out your vibe here: https://ai.flexingdata.com" whatsapp_url = f"https://wa.me/?text={share_text.replace(' ', '%20')}" st.markdown(f"[📲 Share on WhatsApp]({whatsapp_url})")12334huggingface_hub==0.25.2transformerstorchtorchstreamlitapp.py+37-14
requirements.txt+2-1