Spaces:
No application file
No application file
File size: 1,351 Bytes
413cf70 3537f59 413cf70 3537f59 413cf70 3537f59 413cf70 3537f59 413cf70 3537f59 413cf70 3537f59 413cf70 3537f59 413cf70 | 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 | 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() |