File size: 1,074 Bytes
c783314
 
 
 
 
 
 
 
e54adbc
c783314
 
 
 
 
 
 
 
 
e54adbc
 
 
c783314
 
e54adbc
 
 
 
 
 
c783314
e54adbc
 
 
c783314
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import gradio as gr
import websockets
import asyncio
import json
import base64
from PIL import Image
import io

def process_image_stream(question):
    return "This is a test response"

# Create Gradio interface
demo = gr.Interface(
    fn=process_image_stream,
    inputs=[
        gr.Textbox(
            label="Question", 
            placeholder="Ask a question about the image...",
            value="Describe this image",
            scale=1,  # Makes the textbox responsive
            min_width=300  # Minimum width on mobile
        ),
    ],
    outputs=gr.Textbox(
        label="Response", 
        interactive=False,
        scale=1,  # Makes the textbox responsive
        min_width=300  # Minimum width on mobile
    ),
    title="Nexa Omni Vision",
    theme="soft",  # Using a mobile-friendly theme
    css=".gradio-container {max-width: 800px; margin: auto}",  # Responsive container
    allow_flagging="never"  # Removes flagging button for cleaner mobile view
)

if __name__ == "__main__":
    demo.queue().launch(server_name="0.0.0.0", server_port=7860)