Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /gradio-app_gradio /demo /chatinterface_options /run.py
| import gradio as gr | |
| import random | |
| example_code = """ | |
| Here's an example Python lambda function: | |
| lambda x: x + {} | |
| Is this correct? | |
| """ | |
| def chat(message, history): | |
| if message == "Yes, that's correct.": | |
| return "Great!" | |
| else: | |
| return gr.ChatMessage( | |
| content=example_code.format(random.randint(1, 100)), | |
| options=[ | |
| {"value": "Yes, that's correct.", "label": "Yes"}, | |
| {"value": "No"} | |
| ] | |
| ) | |
| demo = gr.ChatInterface( | |
| chat, | |
| examples=["Write an example Python lambda function."], | |
| api_name="chat", | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch() | |
Xet Storage Details
- Size:
- 646 Bytes
- Xet hash:
- 1facca13c1d4253656694e9f6c9264ca49962a9456e4b06ed8bc2086439feb26
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.