Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply Zero GPU for gr.ChatInterface #10081

Merged
merged 12 commits into from
Dec 1, 2024
5 changes: 5 additions & 0 deletions .changeset/little-meals-enter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": minor
---

feat:Apply Zero GPU for `gr.ChatInterface`
4 changes: 3 additions & 1 deletion gradio/chat_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,10 @@ def _setup_example_messages(
return examples_messages

def _setup_events(self) -> None:
submit_fn = self._stream_fn if self.is_generator else self._submit_fn
submit_triggers = [self.textbox.submit, self.chatbot.retry]
submit_fn = self._stream_fn if self.is_generator else self._submit_fn
if hasattr(self.fn, "zerogpu"):
submit_fn.__func__.zerogpu = self.fn.zerogpu # type: ignore

submit_event = (
self.textbox.submit(
Expand Down
Loading