Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,12 +2,19 @@ import os
|
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
|
|
|
|
|
|
|
|
|
|
| 5 |
def respond(message, history):
|
| 6 |
response = f"You said: {message}\nAnd I say I love learning AI Engineering!"
|
| 7 |
return response
|
| 8 |
|
|
|
|
|
|
|
| 9 |
demo = gr.ChatInterface(
|
| 10 |
fn=respond,
|
|
|
|
|
|
|
| 11 |
title="My First Space",
|
| 12 |
description="This is my first space using Gradio.",
|
| 13 |
)
|
|
@@ -15,10 +22,14 @@ demo = gr.ChatInterface(
|
|
| 15 |
|
| 16 |
if __name__ == "__main__":
|
| 17 |
port = int(os.getenv("PORT", "7860"))
|
|
|
|
|
|
|
|
|
|
| 18 |
print(f"Starting Gradio on 0.0.0.0:{port}")
|
| 19 |
demo.launch(
|
| 20 |
server_name="0.0.0.0",
|
| 21 |
server_port=port,
|
| 22 |
share=False,
|
| 23 |
show_error=True,
|
|
|
|
| 24 |
)
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
|
| 5 |
+
BUILD_MARKER = "space-build-2026-07-27-1538"
|
| 6 |
+
|
| 7 |
+
|
| 8 |
def respond(message, history):
|
| 9 |
response = f"You said: {message}\nAnd I say I love learning AI Engineering!"
|
| 10 |
return response
|
| 11 |
|
| 12 |
+
chatbot = gr.Chatbot(type="messages")
|
| 13 |
+
|
| 14 |
demo = gr.ChatInterface(
|
| 15 |
fn=respond,
|
| 16 |
+
type="messages",
|
| 17 |
+
chatbot=chatbot,
|
| 18 |
title="My First Space",
|
| 19 |
description="This is my first space using Gradio.",
|
| 20 |
)
|
|
|
|
| 22 |
|
| 23 |
if __name__ == "__main__":
|
| 24 |
port = int(os.getenv("PORT", "7860"))
|
| 25 |
+
print(f"Build marker: {BUILD_MARKER}")
|
| 26 |
+
print(f"Gradio version: {gr.__version__}")
|
| 27 |
+
print(f"App file: {__file__}")
|
| 28 |
print(f"Starting Gradio on 0.0.0.0:{port}")
|
| 29 |
demo.launch(
|
| 30 |
server_name="0.0.0.0",
|
| 31 |
server_port=port,
|
| 32 |
share=False,
|
| 33 |
show_error=True,
|
| 34 |
+
ssr_mode=False,
|
| 35 |
)
|