Spaces:
Paused
Paused
| 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: <https://example.com> | |
| - 🐙 GitHub: <https://github.com/yourhandle> | |
| - 🧠 Hugging Face: <https://huggingface.co/yourhandle> | |
| - 💼 LinkedIn: <https://linkedin.com/in/yourhandle> | |
| """ | |
| 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() | |