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.%20Py
- Command line
-
hf download 'hf://spaces/Sha77755/Keeps/App. Py'
-
curl -L -o 'App. Py' https://huggingface.co/spaces/Sha77755/Keeps/resolve/main/App.%20Py
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() |