Spaces:
Running
Running
Update app.py from anycoder
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ client = OpenAI(
|
|
| 11 |
}
|
| 12 |
)
|
| 13 |
|
| 14 |
-
def process_message(message, history, image):
|
| 15 |
"""
|
| 16 |
Process user message and image, send to the model, and return the response.
|
| 17 |
"""
|
|
@@ -66,6 +66,9 @@ with gr.Blocks() as demo:
|
|
| 66 |
'</a>'
|
| 67 |
)
|
| 68 |
|
|
|
|
|
|
|
|
|
|
| 69 |
chatbot = gr.Chatbot(
|
| 70 |
label="Conversation",
|
| 71 |
height=400,
|
|
@@ -97,14 +100,14 @@ with gr.Blocks() as demo:
|
|
| 97 |
# Set up the chat interface
|
| 98 |
msg.submit(
|
| 99 |
fn=process_message,
|
| 100 |
-
inputs=[msg, chatbot, img],
|
| 101 |
outputs=[chatbot, chatbot],
|
| 102 |
api_visibility="public"
|
| 103 |
)
|
| 104 |
|
| 105 |
submit_btn.click(
|
| 106 |
fn=process_message,
|
| 107 |
-
inputs=[msg, chatbot, img],
|
| 108 |
outputs=[chatbot, chatbot],
|
| 109 |
api_visibility="public"
|
| 110 |
)
|
|
|
|
| 11 |
}
|
| 12 |
)
|
| 13 |
|
| 14 |
+
def process_message(message, history, image, profile):
|
| 15 |
"""
|
| 16 |
Process user message and image, send to the model, and return the response.
|
| 17 |
"""
|
|
|
|
| 66 |
'</a>'
|
| 67 |
)
|
| 68 |
|
| 69 |
+
# Add OAuth login button
|
| 70 |
+
gr.LoginButton()
|
| 71 |
+
|
| 72 |
chatbot = gr.Chatbot(
|
| 73 |
label="Conversation",
|
| 74 |
height=400,
|
|
|
|
| 100 |
# Set up the chat interface
|
| 101 |
msg.submit(
|
| 102 |
fn=process_message,
|
| 103 |
+
inputs=[msg, chatbot, img, gr.OAuthProfile()],
|
| 104 |
outputs=[chatbot, chatbot],
|
| 105 |
api_visibility="public"
|
| 106 |
)
|
| 107 |
|
| 108 |
submit_btn.click(
|
| 109 |
fn=process_message,
|
| 110 |
+
inputs=[msg, chatbot, img, gr.OAuthProfile()],
|
| 111 |
outputs=[chatbot, chatbot],
|
| 112 |
api_visibility="public"
|
| 113 |
)
|