|
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" |
|
|
|
|
|
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, |
|
min_width=300 |
|
), |
|
], |
|
outputs=gr.Textbox( |
|
label="Response", |
|
interactive=False, |
|
scale=1, |
|
min_width=300 |
|
), |
|
title="Nexa Omni Vision", |
|
theme="soft", |
|
css=".gradio-container {max-width: 800px; margin: auto}", |
|
allow_flagging="never" |
|
) |
|
|
|
if __name__ == "__main__": |
|
demo.queue().launch(server_name="0.0.0.0", server_port=7860) |