Download app.py from Json026/AI_Model: direct link, hf CLI and curl.
- Browser
- Download file 292 Bytes
-
https://huggingface.co/spaces/Json026/AI_Model/resolve/main/app.py
- Command line
-
hf download hf://spaces/Json026/AI_Model/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Json026/AI_Model/resolve/main/app.py
292 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| chatbot = pipeline("text-generation", model="microsoft/DialoGPT-small") | |
| def respond(message): | |
| return chatbot(message, max_length=100)[0]["generated_text"] | |
| demo = gr.Interface(fn=respond, inputs="text", outputs="text") | |
| demo.launch() |