Spaces:
Sleeping
Sleeping
Download app.py from Eeppa/VeryslowAIold: direct link, hf CLI and curl.
- Browser
- Download file 420 Bytes
-
https://huggingface.co/spaces/Eeppa/VeryslowAIold/resolve/main/app.py
- Command line
-
hf download hf://spaces/Eeppa/VeryslowAIold/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Eeppa/VeryslowAIold/resolve/main/app.py
420 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| # Loading the 124M version for lightning speed on CPU | |
| generator = pipeline('text-generation', model='gpt2') | |
| def predict(prompt): | |
| # GPT-2 needs a bit of 'length' to show its true colors | |
| output = generator(prompt, max_length=150, num_return_sequences=1) | |
| return output[0]['generated_text'] | |
| gr.Interface(fn=predict, inputs="text", outputs="text").launch() |