PerryCheng614 commited on
Commit
e54adbc
·
1 Parent(s): d839dfe
Files changed (1) hide show
  1. app.py +13 -17
app.py CHANGED
@@ -6,35 +6,31 @@ import base64
6
  from PIL import Image
7
  import io
8
 
9
- def process_image_stream(question, max_tokens):
10
  return "This is a test response"
11
 
12
  # Create Gradio interface
13
  demo = gr.Interface(
14
  fn=process_image_stream,
15
  inputs=[
16
- # gr.Image(type="filepath", label="Upload Image"),
17
  gr.Textbox(
18
  label="Question",
19
  placeholder="Ask a question about the image...",
20
- value="Describe this image"
 
 
21
  ),
22
- # gr.Slider(
23
- # minimum=50,
24
- # maximum=200,
25
- # value=200,
26
- # step=1,
27
- # label="Max Tokens"
28
- # )
29
  ],
30
- outputs=gr.Textbox(label="Response", interactive=False),
 
 
 
 
 
31
  title="Nexa Omni Vision",
32
- # description=f"""
33
- # Model Repo: <a href="https://huggingface.co/NexaAIDev/omnivision-968M">NexaAIDev/omnivision-968M</a>
34
-
35
- # *Model updated on Nov 21, 2024\n
36
- # Upload an image and ask questions about it. The model will analyze the image and provide detailed answers to your queries.
37
- # """,
38
  )
39
 
40
  if __name__ == "__main__":
 
6
  from PIL import Image
7
  import io
8
 
9
+ def process_image_stream(question):
10
  return "This is a test response"
11
 
12
  # Create Gradio interface
13
  demo = gr.Interface(
14
  fn=process_image_stream,
15
  inputs=[
 
16
  gr.Textbox(
17
  label="Question",
18
  placeholder="Ask a question about the image...",
19
+ value="Describe this image",
20
+ scale=1, # Makes the textbox responsive
21
+ min_width=300 # Minimum width on mobile
22
  ),
 
 
 
 
 
 
 
23
  ],
24
+ outputs=gr.Textbox(
25
+ label="Response",
26
+ interactive=False,
27
+ scale=1, # Makes the textbox responsive
28
+ min_width=300 # Minimum width on mobile
29
+ ),
30
  title="Nexa Omni Vision",
31
+ theme="soft", # Using a mobile-friendly theme
32
+ css=".gradio-container {max-width: 800px; margin: auto}", # Responsive container
33
+ allow_flagging="never" # Removes flagging button for cleaner mobile view
 
 
 
34
  )
35
 
36
  if __name__ == "__main__":