Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -44,10 +44,10 @@ def bot_streaming(message, history):
|
|
44 |
try:
|
45 |
if image is None:
|
46 |
# Handle the case where image is None
|
47 |
-
raise gr.Error("You need to upload an image for
|
48 |
except NameError:
|
49 |
# Handle the case where 'image' is not defined at all
|
50 |
-
raise gr.Error("You need to upload an image for
|
51 |
|
52 |
conversation = []
|
53 |
flag=False
|
@@ -62,7 +62,6 @@ def bot_streaming(message, history):
|
|
62 |
conversation.extend([{"role": "assistant", "content": assistant}])
|
63 |
flag=False
|
64 |
continue
|
65 |
-
#conversation += f"""User:<image>\n{user} Falcon:{assistant} """
|
66 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
67 |
|
68 |
if len(history) == 0:
|
@@ -96,10 +95,10 @@ chat_input = gr.MultimodalTextbox(interactive=True, file_types=["image"], placeh
|
|
96 |
with gr.Blocks(fill_height=True, ) as demo:
|
97 |
gr.ChatInterface(
|
98 |
fn=bot_streaming,
|
99 |
-
title="
|
100 |
examples=[{"text": "What is on the flower?", "files": ["./bee.jpg"]},
|
101 |
{"text": "How to make this pastry?", "files": ["./baklava.png"]}],
|
102 |
-
description="Try [
|
103 |
stop_btn="Stop Generation",
|
104 |
multimodal=True,
|
105 |
textbox=chat_input,
|
|
|
44 |
try:
|
45 |
if image is None:
|
46 |
# Handle the case where image is None
|
47 |
+
raise gr.Error("You need to upload an image for Phi3-Vision to work. Close the error and try again with an Image.")
|
48 |
except NameError:
|
49 |
# Handle the case where 'image' is not defined at all
|
50 |
+
raise gr.Error("You need to upload an image for Phi3-Vision to work. Close the error and try again with an Image.")
|
51 |
|
52 |
conversation = []
|
53 |
flag=False
|
|
|
62 |
conversation.extend([{"role": "assistant", "content": assistant}])
|
63 |
flag=False
|
64 |
continue
|
|
|
65 |
conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
|
66 |
|
67 |
if len(history) == 0:
|
|
|
95 |
with gr.Blocks(fill_height=True, ) as demo:
|
96 |
gr.ChatInterface(
|
97 |
fn=bot_streaming,
|
98 |
+
title="Phi3 Vision 128K Instruct",
|
99 |
examples=[{"text": "What is on the flower?", "files": ["./bee.jpg"]},
|
100 |
{"text": "How to make this pastry?", "files": ["./baklava.png"]}],
|
101 |
+
description="Try [microsoft/Phi-3-vision-128k-instruct](https://huggingface.co/microsoft/Phi-3-vision-128k-instruct). Upload an image and start chatting about it, or simply try one of the examples below. If you won't upload an image, you will receive an error.",
|
102 |
stop_btn="Stop Generation",
|
103 |
multimodal=True,
|
104 |
textbox=chat_input,
|