suayptalha commited on
Commit
d2449dc
·
verified ·
1 Parent(s): a7527fb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -11
app.py CHANGED
@@ -53,15 +53,11 @@ def chat_or_image(image, user_message):
53
  history.append(f"User: {user_message}")
54
  return respond(user_message, history, "System: Answer the user's question.", 512, 0.7, 0.95)
55
 
56
- demo = gr.Interface(
57
- fn=chat_or_image,
58
- inputs=[
59
- gr.Image(type="filepath", label="Upload Image (optional)", elem_id="left-column"),
60
- gr.Textbox(label="Ask or Chat", placeholder="Ask a question...", lines=2, elem_id="right-column")
61
- ],
62
- outputs="text",
63
- layout="horizontal", # Adjust the layout to horizontal
64
- )
65
-
66
- if __name__ == "__main__":
67
  demo.launch(show_error=True)
 
53
  history.append(f"User: {user_message}")
54
  return respond(user_message, history, "System: Answer the user's question.", 512, 0.7, 0.95)
55
 
56
+ with gr.Blocks() as demo:
57
+ with gr.Row():
58
+ with gr.Column(scale=1):
59
+ gr.Image(type="filepath", label="Upload Image (optional)", elem_id="left-column")
60
+ with gr.Column(scale=2):
61
+ gr.Textbox(label="Ask or Chat", placeholder="Ask a question...", lines=2, elem_id="right-column")
62
+
 
 
 
 
63
  demo.launch(show_error=True)