Spaces:
Sleeping
Sleeping
Download app.py from marcomueller909/test1: direct link, hf CLI and curl.
- Browser
- Download file 461 Bytes
-
https://huggingface.co/spaces/marcomueller909/test1/resolve/main/app.py
- Command line
-
hf download hf://spaces/marcomueller909/test1/app.py
-
curl -L -o app.py https://huggingface.co/spaces/marcomueller909/test1/resolve/main/app.py
461 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| generator = pipeline("text-generation", model="dbmdz/german-gpt2") | |
| def generate_text(prompt): | |
| result = generator(prompt, max_length=50, do_sample=True, top_k=50) | |
| return result[0]['generated_text'] | |
| iface = gr.Interface( | |
| fn=generate_text, | |
| inputs=gr.Textbox(lines=2, placeholder="Gib hier deinen Starttext ein..."), | |
| outputs="text", | |
| title="1. Test mit Hugging Face" | |
| ) | |
| iface.launch() | |