Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,6 +9,15 @@ from transformers import TextIteratorStreamer
|
|
| 9 |
|
| 10 |
import spaces
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
model_id = "xtuner/llava-llama-3-8b-v1_1-transformers"
|
| 13 |
|
| 14 |
processor = AutoProcessor.from_pretrained(model_id)
|
|
@@ -78,13 +87,14 @@ def bot_streaming(message, history):
|
|
| 78 |
|
| 79 |
demo = gr.ChatInterface(
|
| 80 |
fn=bot_streaming,
|
| 81 |
-
fill_height=
|
| 82 |
title="LLaVA Llama-3-8B",
|
| 83 |
examples=[{"text": "What is on the flower?", "files": ["./bee.jpg"]},
|
| 84 |
{"text": "How to make this pastry?", "files": ["./baklava.png"]}],
|
| 85 |
description="Try [LLaVA Llama-3-8B](https://huggingface.co/xtuner/llava-llama-3-8b-v1_1-transformers). Upload an image and start chatting about it, or simply try one of the examples below. If you don't upload an image, you will receive an error.",
|
| 86 |
stop_btn="Stop Generation",
|
| 87 |
-
multimodal=True
|
|
|
|
| 88 |
)
|
| 89 |
|
| 90 |
demo.queue(api_open=False)
|
|
|
|
| 9 |
|
| 10 |
import spaces
|
| 11 |
|
| 12 |
+
|
| 13 |
+
PLACEHOLDER = """
|
| 14 |
+
<div style="padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center;">
|
| 15 |
+
<img src="https://cdn-uploads.huggingface.co/production/uploads/64ccdc322e592905f922a06e/DDIW0kbWmdOQWwy4XMhwX.png" style="width: 80%; max-width: 550px; height: auto; opacity: 0.55; ">
|
| 16 |
+
<h1 style="font-size: 28px; margin-bottom: 2px; opacity: 0.55;">LLaVA-Llama-3-8B</h1>
|
| 17 |
+
<p style="font-size: 18px; margin-bottom: 2px; opacity: 0.65;">Llava-Llama-3-8b is a LLaVA model fine-tuned from Meta-Llama-3-8B-Instruct and CLIP-ViT-Large-patch14-336 with ShareGPT4V-PT and InternVL-SFT by XTuner</p>
|
| 18 |
+
</div>
|
| 19 |
+
"""
|
| 20 |
+
|
| 21 |
model_id = "xtuner/llava-llama-3-8b-v1_1-transformers"
|
| 22 |
|
| 23 |
processor = AutoProcessor.from_pretrained(model_id)
|
|
|
|
| 87 |
|
| 88 |
demo = gr.ChatInterface(
|
| 89 |
fn=bot_streaming,
|
| 90 |
+
fill_height=True,
|
| 91 |
title="LLaVA Llama-3-8B",
|
| 92 |
examples=[{"text": "What is on the flower?", "files": ["./bee.jpg"]},
|
| 93 |
{"text": "How to make this pastry?", "files": ["./baklava.png"]}],
|
| 94 |
description="Try [LLaVA Llama-3-8B](https://huggingface.co/xtuner/llava-llama-3-8b-v1_1-transformers). Upload an image and start chatting about it, or simply try one of the examples below. If you don't upload an image, you will receive an error.",
|
| 95 |
stop_btn="Stop Generation",
|
| 96 |
+
multimodal=True,
|
| 97 |
+
placeholder=PLACEHOLDER,
|
| 98 |
)
|
| 99 |
|
| 100 |
demo.queue(api_open=False)
|