nikhilalgorithma commited on
Commit
a7a575b
·
verified ·
1 Parent(s): fafb45a
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -19,9 +19,7 @@ model.to("cuda:0")
19
 
20
  PLACEHOLDER = """
21
  <div style="padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center;">
22
- <img src="https://cdn-thumbnails.huggingface.co/social-thumbnails/models/microsoft/Phi-3-vision-128k-instruct.png" style="width: 80%; max-width: 550px; height: auto; opacity: 0.55; ">
23
- <h1 style="font-size: 28px; margin-bottom: 2px; opacity: 0.55;">Microsoft's Phi3 Vision</h1>
24
- <p style="font-size: 18px; margin-bottom: 2px; opacity: 0.65;">Phi-3-Vision is a 4.2B parameter multimodal model that brings together language and vision capabilities.</p>
25
  </div>
26
  """
27
 
@@ -44,10 +42,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 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
@@ -90,14 +88,14 @@ chat_input = gr.MultimodalTextbox(interactive=True, file_types=["image"], placeh
90
  with gr.Blocks(fill_height=True, ) as demo:
91
  gr.ChatInterface(
92
  fn=bot_streaming,
93
- title="Phi3 Vision 128K Instruct",
94
  examples=[{"text": "Describe the image in details?", "files": ["./robo.jpg"]},
95
  {"text": "What does the chart display?", "files": ["./dataviz.png"]},
96
  {"text": "What is 3?", "files": ["./setofmark1.jpg"]},
97
  {"text": "Count the number of apples.", "files": ["./setofmark6.png"]},
98
  {"text": "I want to find a seat close to windows, where can I sit?", "files": ["./office1.jpg"]},
99
  ],
100
- description="Try the [Phi3-Vision model](https://huggingface.co/microsoft/Phi-3-vision-128k-instruct) from Microsoft. 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. This is not the official demo.",
101
  stop_btn="Stop Generation",
102
  multimodal=True,
103
  textbox=chat_input,
 
19
 
20
  PLACEHOLDER = """
21
  <div style="padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center;">
22
+ <p style="font-size: 18px; margin-bottom: 2px; opacity: 0.65;">DifferentByte vision model</p>
 
 
23
  </div>
24
  """
25
 
 
42
  try:
43
  if image is None:
44
  # Handle the case where image is None
45
+ raise gr.Error("You need to upload an image for DifferentByte Vision to work. Close the error and try again with an Image.")
46
  except NameError:
47
  # Handle the case where 'image' is not defined at all
48
+ raise gr.Error("You need to upload an image for Vision to work. Close the error and try again with an Image.")
49
 
50
  conversation = []
51
  flag=False
 
88
  with gr.Blocks(fill_height=True, ) as demo:
89
  gr.ChatInterface(
90
  fn=bot_streaming,
91
+ title="DifferentByt",
92
  examples=[{"text": "Describe the image in details?", "files": ["./robo.jpg"]},
93
  {"text": "What does the chart display?", "files": ["./dataviz.png"]},
94
  {"text": "What is 3?", "files": ["./setofmark1.jpg"]},
95
  {"text": "Count the number of apples.", "files": ["./setofmark6.png"]},
96
  {"text": "I want to find a seat close to windows, where can I sit?", "files": ["./office1.jpg"]},
97
  ],
98
+ description="Upload an image and start chatting.This is not the official demo.",
99
  stop_btn="Stop Generation",
100
  multimodal=True,
101
  textbox=chat_input,