Download tuples_examples_testcase.py from gradio/test_chatinterface_examples_main: direct link, hf CLI and curl.
- Browser
- Download file 444 Bytes
-
https://huggingface.co/spaces/gradio/test_chatinterface_examples_main/resolve/93e8d60f85d5f9cae3e4fdbdc00a9923ee3de914/tuples_examples_testcase.py
- Command line
-
hf download hf://spaces/gradio/test_chatinterface_examples_main@93e8d60f85d5f9cae3e4fdbdc00a9923ee3de914/tuples_examples_testcase.py
-
curl -L -o tuples_examples_testcase.py https://huggingface.co/spaces/gradio/test_chatinterface_examples_main/resolve/93e8d60f85d5f9cae3e4fdbdc00a9923ee3de914/tuples_examples_testcase.py
444 Bytes
| import gradio as gr | |
| def generate( | |
| message: str, | |
| chat_history: list[dict], | |
| ): | |
| output = "" | |
| for character in message: | |
| output += character | |
| yield output | |
| demo = gr.ChatInterface( | |
| fn=generate, | |
| examples=[ | |
| ["Hey"], | |
| ["Can you explain briefly to me what is the Python programming language?"], | |
| ], | |
| cache_examples=False, | |
| type="tuples", | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch() | |