Spaces:
No application file
No application file
Download app.py from CodeXDevloper/codex: direct link, hf CLI and curl.
- Browser
- Download file 1.35 kB
-
https://huggingface.co/spaces/CodeXDevloper/codex/resolve/413cf705cec958502bd0396216c3b7fcd4e033b0/app.py
- Command line
-
hf download hf://spaces/CodeXDevloper/codex@413cf705cec958502bd0396216c3b7fcd4e033b0/app.py
-
curl -L -o app.py https://huggingface.co/spaces/CodeXDevloper/codex/resolve/413cf705cec958502bd0396216c3b7fcd4e033b0/app.py
1.35 kB
| import gradio as gr | |
| from datasets import load_dataset | |
| DATASET = "CodeXDevloper/MergedTgDataset" | |
| def search_uid(uid): | |
| if not uid: | |
| return {"error": "UID daalo"} | |
| try: | |
| ds = load_dataset(DATASET, split="train", streaming=True) | |
| for row in ds: | |
| if uid == str(row.get("user_id", "")).strip(): | |
| return { | |
| "found": True, | |
| "user_id": row.get("user_id"), | |
| "username": row.get("username"), | |
| "first_name": row.get("first_name"), | |
| "last_name": row.get("last_name"), | |
| "phone": row.get("phone"), | |
| "email": row.get("email"), | |
| "status": row.get("status"), | |
| "linked_id": row.get("linked_id"), | |
| "linked_name": row.get("linked_name"), | |
| "linked_handle": row.get("linked_handle"), | |
| } | |
| return {"found": False, "message": f"UID '{uid}' nahi mila"} | |
| except Exception as e: | |
| return {"error": str(e)} | |
| demo = gr.Interface( | |
| fn=search_uid, | |
| inputs=gr.Textbox(label="UID daalo", placeholder="385167100"), | |
| outputs=gr.JSON(label="Result"), | |
| title="Telegram UID Search", | |
| description="UID daal ke poore dataset mein search karo" | |
| ) | |
| demo.launch() |