Spaces:
Runtime error
Runtime error
Download app.py from sucheendra93/simple-text-model: direct link, hf CLI and curl.
- Browser
- Download file 324 Bytes
-
https://huggingface.co/spaces/sucheendra93/simple-text-model/resolve/main/app.py
- Command line
-
hf download hf://spaces/sucheendra93/simple-text-model/app.py
-
curl -L -o app.py https://huggingface.co/spaces/sucheendra93/simple-text-model/resolve/main/app.py
324 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| model = pipeline("text-generation", model="distilgpt2") | |
| def generate_text(prompt): | |
| result = model(prompt, max_length=50) | |
| return result[0]["generated_text"] | |
| app = gr.Interface( | |
| fn=generate_text, | |
| inputs="text", | |
| outputs="text", | |
| title="Simple Text Generator" | |
| ) | |
| app.launch() | |