Skip to content

Commit

Permalink
Apply Zero GPU for gr.ChatInterface (#10081)
Browse files Browse the repository at this point in the history
* zero gpu

* add changeset

* changes

* changes

* add changeset

* change

* check

* add changeset

* format

---------

Co-authored-by: gradio-pr-bot <[email protected]>
  • Loading branch information
abidlabs and gradio-pr-bot authored Dec 1, 2024
1 parent ebe25bc commit b94f010
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
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 @@ -337,8 +337,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

0 comments on commit b94f010

Please sign in to comment.