Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahblair committed Dec 13, 2024
1 parent 6c6fc4f commit 2e22899
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gradio/chat_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def __init__(
self.provided_chatbot = chatbot is not None
self.examples = examples
self.examples_messages = self._setup_example_messages(
examples, example_labels, example_icons, multimodal
examples, example_labels, example_icons
)
self.run_examples_on_click = run_examples_on_click
self.cache_examples = cache_examples
Expand Down Expand Up @@ -319,12 +319,11 @@ def __init__(
self._setup_events()
self._setup_api()

@staticmethod
def _setup_example_messages(
self,
examples: list[str] | list[MultimodalValue] | list[list] | None,
example_labels: list[str] | None = None,
example_icons: list[str] | None = None,
multimodal: bool = False,
) -> list[ExampleMessage]:
examples_messages = []
if examples:
Expand All @@ -339,7 +338,7 @@ def _setup_example_messages(
example_message["files"] = example.get("files", [])
if example_labels:
example_message["display_text"] = example_labels[index]
if multimodal:
if self.multimodal:
example_files = example_message.get("files")
if not example_files:
if example_icons:
Expand Down

0 comments on commit 2e22899

Please sign in to comment.