Spaces:
Runtime error
Runtime error
Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -5,7 +5,7 @@ emoji: 🔥
|
|
| 5 |
colorFrom: indigo
|
| 6 |
colorTo: indigo
|
| 7 |
sdk: gradio
|
| 8 |
-
sdk_version:
|
| 9 |
app_file: run.py
|
| 10 |
pinned: false
|
| 11 |
hf_oauth: true
|
|
|
|
| 5 |
colorFrom: indigo
|
| 6 |
colorTo: indigo
|
| 7 |
sdk: gradio
|
| 8 |
+
sdk_version: 6.0.0
|
| 9 |
app_file: run.py
|
| 10 |
pinned: false
|
| 11 |
hf_oauth: true
|
cached_testcase.py
CHANGED
|
@@ -1,18 +1,17 @@
|
|
| 1 |
-
from pathlib import Path
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
-
image =
|
| 5 |
-
audio =
|
| 6 |
|
| 7 |
def echo(message, history):
|
| 8 |
return f"You wrote: {message['text']} and uploaded {len(message['files'])} files."
|
| 9 |
|
| 10 |
demo = gr.ChatInterface(
|
| 11 |
fn=echo,
|
| 12 |
-
type="messages",
|
| 13 |
examples=[{"text": "hello"}, {"text": "hola", "files": [image]}, {"text": "merhaba", "files": [image, audio]}],
|
| 14 |
title="Echo Bot",
|
| 15 |
multimodal=True,
|
|
|
|
| 16 |
)
|
| 17 |
|
| 18 |
if __name__ == "__main__":
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
image = gr.get_image("avatar.png")
|
| 4 |
+
audio = gr.get_audio("cantina.wav")
|
| 5 |
|
| 6 |
def echo(message, history):
|
| 7 |
return f"You wrote: {message['text']} and uploaded {len(message['files'])} files."
|
| 8 |
|
| 9 |
demo = gr.ChatInterface(
|
| 10 |
fn=echo,
|
|
|
|
| 11 |
examples=[{"text": "hello"}, {"text": "hola", "files": [image]}, {"text": "merhaba", "files": [image, audio]}],
|
| 12 |
title="Echo Bot",
|
| 13 |
multimodal=True,
|
| 14 |
+
api_name="chat",
|
| 15 |
)
|
| 16 |
|
| 17 |
if __name__ == "__main__":
|
run.ipynb
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: test_chatinterface_multimodal_examples"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["# Downloading files from the demo repo\n", "import os\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/test_chatinterface_multimodal_examples/cached_testcase.py"]}, {"cell_type": "code", "execution_count": null, "id": "44380577570523278879349135829904343037", "metadata": {}, "outputs": [], "source": ["
|
|
|
|
| 1 |
+
{"cells": [{"cell_type": "markdown", "id": "302934307671667531413257853548643485645", "metadata": {}, "source": ["# Gradio Demo: test_chatinterface_multimodal_examples"]}, {"cell_type": "code", "execution_count": null, "id": "272996653310673477252411125948039410165", "metadata": {}, "outputs": [], "source": ["!pip install -q gradio "]}, {"cell_type": "code", "execution_count": null, "id": "288918539441861185822528903084949547379", "metadata": {}, "outputs": [], "source": ["# Downloading files from the demo repo\n", "import os\n", "!wget -q https://github.com/gradio-app/gradio/raw/main/demo/test_chatinterface_multimodal_examples/cached_testcase.py"]}, {"cell_type": "code", "execution_count": null, "id": "44380577570523278879349135829904343037", "metadata": {}, "outputs": [], "source": ["import gradio as gr\n", "\n", "image = gr.get_image(\"avatar.png\")\n", "audio = gr.get_audio(\"cantina.wav\")\n", "\n", "def echo(message, history):\n", " return f\"You wrote: {message['text']} and uploaded {len(message['files'])} files.\"\n", "\n", "demo = gr.ChatInterface(\n", " fn=echo,\n", " examples=[{\"text\": \"hello\"}, {\"text\": \"hola\", \"files\": [image]}, {\"text\": \"merhaba\", \"files\": [image, audio]}],\n", " title=\"Echo Bot\",\n", " multimodal=True,\n", " api_name=\"chat\",\n", ")\n", "\n", "if __name__ == \"__main__\":\n", " demo.launch()\n"]}], "metadata": {}, "nbformat": 4, "nbformat_minor": 5}
|
run.py
CHANGED
|
@@ -1,18 +1,17 @@
|
|
| 1 |
-
from pathlib import Path
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
-
image =
|
| 5 |
-
audio =
|
| 6 |
|
| 7 |
def echo(message, history):
|
| 8 |
return f"You wrote: {message['text']} and uploaded {len(message['files'])} files."
|
| 9 |
|
| 10 |
demo = gr.ChatInterface(
|
| 11 |
fn=echo,
|
| 12 |
-
type="messages",
|
| 13 |
examples=[{"text": "hello"}, {"text": "hola", "files": [image]}, {"text": "merhaba", "files": [image, audio]}],
|
| 14 |
title="Echo Bot",
|
| 15 |
multimodal=True,
|
|
|
|
| 16 |
)
|
| 17 |
|
| 18 |
if __name__ == "__main__":
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
image = gr.get_image("avatar.png")
|
| 4 |
+
audio = gr.get_audio("cantina.wav")
|
| 5 |
|
| 6 |
def echo(message, history):
|
| 7 |
return f"You wrote: {message['text']} and uploaded {len(message['files'])} files."
|
| 8 |
|
| 9 |
demo = gr.ChatInterface(
|
| 10 |
fn=echo,
|
|
|
|
| 11 |
examples=[{"text": "hello"}, {"text": "hola", "files": [image]}, {"text": "merhaba", "files": [image, audio]}],
|
| 12 |
title="Echo Bot",
|
| 13 |
multimodal=True,
|
| 14 |
+
api_name="chat",
|
| 15 |
)
|
| 16 |
|
| 17 |
if __name__ == "__main__":
|