import gradio as gr from datetime import datetime NAME = "Muhammad Saad" TAGLINE = "CS @ North South University β€’ Tech enthusiast β€’ Builder of fun things" ABOUT_MD = f""" # πŸ‘‹ Hey, I'm {NAME} I'm a **Computer Science student at North South University** who loves shipping scrappy ideas, breaking stuff (on purpose), and then fixing it better. **What I'm into:** computer vision, MLOps, model deployment, and turning notebooks into real apps. """ # ← add your real links here SOCIALS_MD = """ **Find me:** - 🌐 Website: - πŸ™ GitHub: - 🧠 Hugging Face: - πŸ’Ό LinkedIn: """ PROJECTS_MD = """ ### Selected Projects - **Image Similarity App** β€” FAISS + ResNet embeddings to retrieve near-duplicate medical images. - **Radiology Captioning Playground** β€” demo of ViT+GPT2 captioner with retrieval-augmented context. - **Tiny MLOps** β€” Dockerized inference + Space deploy in under 5 minutes. """ # funny-but-true skills SKILLS_MD = """ ### Skills (serious-ish) - **Python**, **PyTorch**, **Gradio**, **Hugging Face**, **FAISS**, **Docker** - **Data wrangling**, **Training pipelines**, **Model serving**, **Prompt tinkering** ### Skills (funny but accurate) - **Googling like a Pro**: 10/10 πŸ” - **Debugging at 2 AM**: 11/10 🧯 - **β€œIt worked yesterday” Whisperer**: 9/10 πŸ§™ - **Version Control Therapist (merge conflicts)**: 8/10 πŸͺ„ - **Coffee-driven latency reduction**: -20ms β˜• """ CONTACT_HELP = """ I can't send email for you, but this will format a message you can copy-paste. Or use the **mailto** button to open your email client. """ def format_contact(name, email, message): ts = datetime.now().strftime("%Y-%m-%d %H:%M") return f"""### Thanks, {name or "friend"}! **Time:** {ts} **From:** {name} ({email}) **Message:** > {message} """ def mailto_link(name, email, message): import urllib.parse as up to = "you@example.com" # ← replace with your address subject = up.quote(f"Portfolio message from {name or 'Visitor'}") body = up.quote(f"From: {name} <{email}>\n\n{message}") return f"mailto:{to}?subject={subject}&body={body}" with gr.Blocks(title=f"{NAME} β€” Portfolio") as demo: gr.Markdown(f"# {NAME}\n**{TAGLINE}**") with gr.Tab("About"): gr.Markdown(ABOUT_MD) gr.Markdown(SOCIALS_MD) with gr.Tab("Projects"): gr.Markdown(PROJECTS_MD) gr.Markdown("*(Want live demos here? Link your Spaces or add iframes.)*") with gr.Tab("Skills"): gr.Markdown(SKILLS_MD) with gr.Tab("Contact"): gr.Markdown(CONTACT_HELP) with gr.Row(): name = gr.Textbox(label="Your name", placeholder="Ada Lovelace") email = gr.Textbox(label="Your email", placeholder="ada@example.com") message = gr.Textbox(label="Message", lines=6, placeholder="Write me something nice…") with gr.Row(): out = gr.Markdown() with gr.Row(): btn_send = gr.Button("Preview message") btn_mail = gr.Button("Open email client (mailto)") btn_send.click(format_contact, [name, email, message], out) btn_mail.click(mailto_link, [name, email, message], out) if __name__ == "__main__": demo.launch()