Download app.py from Sha77755/Keeps: direct link, hf CLI and curl.
- Browser
- Download file 568 Bytes
-
https://huggingface.co/spaces/Sha77755/Keeps/resolve/main/app.py
- Command line
-
hf download hf://spaces/Sha77755/Keeps/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Sha77755/Keeps/resolve/main/app.py
568 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| # Text-to-image pipeline initialize karna | |
| pipe = pipeline("text-to-image-generation", model="dalle-mini/dalle-mini") | |
| def generate_image(text): | |
| # Text se image generate karna | |
| result = pipe(text) | |
| return result[0]["generated_image"] | |
| # Gradio Interface banana | |
| iface = gr.Interface( | |
| fn=generate_image, | |
| inputs="text", | |
| outputs="image", | |
| title="Text-to-Image Generator", | |
| description="Enter a description, and this AI will generate an image based on it." | |
| ) | |
| # Launch the app | |
| iface.launch() |