Spaces:
Runtime error
Runtime error
Download app.py from rebase/hello_python: direct link, hf CLI and curl.
- Browser
- Download file 385 Bytes
-
https://huggingface.co/spaces/rebase/hello_python/resolve/b7feab4ef9a25a9bcf1c27d44eeec5bf3add5821/app.py
- Command line
-
hf download hf://spaces/rebase/hello_python@b7feab4ef9a25a9bcf1c27d44eeec5bf3add5821/app.py
-
curl -L -o app.py https://huggingface.co/spaces/rebase/hello_python/resolve/b7feab4ef9a25a9bcf1c27d44eeec5bf3add5821/app.py
385 Bytes
| import gradio as gr | |
| from datasets import load_dataset | |
| from transformers import pipeline | |
| dataset = load_dataset("rebase/hello") | |
| model = pipeline("text-generation") | |
| def image_classifier(inp): | |
| return dataset | |
| def predict(prompt): | |
| completion = model(prompt)[0]["generated_text"] | |
| return completion | |
| demo = gr.Interface(fn=predict, inputs="text", outputs="text") | |
| demo.launch() | |