Spaces:
Runtime error
Runtime error
Download app.py from MUTSC/TextGen-GPT2: direct link, hf CLI and curl.
- Browser
- Download file 255 Bytes
-
https://huggingface.co/spaces/MUTSC/TextGen-GPT2/resolve/main/app.py
- Command line
-
hf download hf://spaces/MUTSC/TextGen-GPT2/app.py
-
curl -L -o app.py https://huggingface.co/spaces/MUTSC/TextGen-GPT2/resolve/main/app.py
255 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| model = pipeline("text-generation") | |
| def predict(prompt): | |
| completion = model(prompt)[0]["generated_text"] | |
| return completion | |
| gr.Interface(fn=predict, inputs="text", outputs="text").launch() | |