Spaces:
Sleeping
Sleeping
ใ
ใ
ใ
commited on
Commit ยท
2f2a20d
1
Parent(s): 9ce2479
fix: update gradio 5.0 API - remove show_copy_button, move theme/css to launch()
Browse files- CodeWeaver/ui/app.py +20 -20
CodeWeaver/ui/app.py
CHANGED
|
@@ -31,6 +31,22 @@ logging.getLogger("src.vector_db").setLevel(logging.WARNING)
|
|
| 31 |
|
| 32 |
logger = logging.getLogger(__name__)
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
def chat(
|
| 36 |
message: str,
|
|
@@ -78,26 +94,8 @@ def chat(
|
|
| 78 |
def create_demo() -> gr.Blocks:
|
| 79 |
"""Gradio ์ธํฐํ์ด์ค๋ฅผ ์์ฑํฉ๋๋ค."""
|
| 80 |
|
| 81 |
-
# CSS ์คํ์ผ (ํ๋ฉด ๋๋น ๊ณ ์ ๋ฐ ๊ฐ๋
์ฑ ํฅ์)
|
| 82 |
-
css = """
|
| 83 |
-
.gradio-container {
|
| 84 |
-
max-width: 1280px !important;
|
| 85 |
-
width: min(1280px, 100%) !important;
|
| 86 |
-
margin: 0 auto !important;
|
| 87 |
-
}
|
| 88 |
-
.contain {
|
| 89 |
-
max-width: 1280px !important;
|
| 90 |
-
width: min(1280px, 100%) !important;
|
| 91 |
-
margin: 0 auto !important;
|
| 92 |
-
padding-top: 1.5rem;
|
| 93 |
-
}
|
| 94 |
-
.message { font-size: 1.1rem; line-height: 1.6; }
|
| 95 |
-
"""
|
| 96 |
-
|
| 97 |
with gr.Blocks(
|
| 98 |
-
title="CodeWeaver - AI ๊ฐ๋ฐ ๋์ฐ๋ฏธ"
|
| 99 |
-
theme=gr.themes.Soft(),
|
| 100 |
-
css=css
|
| 101 |
) as demo:
|
| 102 |
|
| 103 |
gr.Markdown("""
|
|
@@ -148,7 +146,7 @@ def create_demo() -> gr.Blocks:
|
|
| 148 |
chatbot_interface = gr.ChatInterface(
|
| 149 |
fn=chat,
|
| 150 |
examples=None,
|
| 151 |
-
chatbot=gr.Chatbot(height=550
|
| 152 |
textbox=gr.Textbox(
|
| 153 |
placeholder="๊ฐ๋ฐ ๊ด๋ จ ์ง๋ฌธ์ ์
๋ ฅํ์ธ์... (์: 'React useEffect ๋ฌดํ ๋ฃจํ ํด๊ฒฐ๋ฒ')",
|
| 154 |
container=False,
|
|
@@ -240,4 +238,6 @@ if __name__ == "__main__":
|
|
| 240 |
server_port=7860,
|
| 241 |
share=False,
|
| 242 |
show_api=False,
|
|
|
|
|
|
|
| 243 |
)
|
|
|
|
| 31 |
|
| 32 |
logger = logging.getLogger(__name__)
|
| 33 |
|
| 34 |
+
# CSS ์คํ์ผ (ํ๋ฉด ๋๋น ๊ณ ์ ๋ฐ ๊ฐ๋
์ฑ ํฅ์)
|
| 35 |
+
CSS = """
|
| 36 |
+
.gradio-container {
|
| 37 |
+
max-width: 1280px !important;
|
| 38 |
+
width: min(1280px, 100%) !important;
|
| 39 |
+
margin: 0 auto !important;
|
| 40 |
+
}
|
| 41 |
+
.contain {
|
| 42 |
+
max-width: 1280px !important;
|
| 43 |
+
width: min(1280px, 100%) !important;
|
| 44 |
+
margin: 0 auto !important;
|
| 45 |
+
padding-top: 1.5rem;
|
| 46 |
+
}
|
| 47 |
+
.message { font-size: 1.1rem; line-height: 1.6; }
|
| 48 |
+
"""
|
| 49 |
+
|
| 50 |
|
| 51 |
def chat(
|
| 52 |
message: str,
|
|
|
|
| 94 |
def create_demo() -> gr.Blocks:
|
| 95 |
"""Gradio ์ธํฐํ์ด์ค๋ฅผ ์์ฑํฉ๋๋ค."""
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
with gr.Blocks(
|
| 98 |
+
title="CodeWeaver - AI ๊ฐ๋ฐ ๋์ฐ๋ฏธ"
|
|
|
|
|
|
|
| 99 |
) as demo:
|
| 100 |
|
| 101 |
gr.Markdown("""
|
|
|
|
| 146 |
chatbot_interface = gr.ChatInterface(
|
| 147 |
fn=chat,
|
| 148 |
examples=None,
|
| 149 |
+
chatbot=gr.Chatbot(height=550),
|
| 150 |
textbox=gr.Textbox(
|
| 151 |
placeholder="๊ฐ๋ฐ ๊ด๋ จ ์ง๋ฌธ์ ์
๋ ฅํ์ธ์... (์: 'React useEffect ๋ฌดํ ๋ฃจํ ํด๊ฒฐ๋ฒ')",
|
| 152 |
container=False,
|
|
|
|
| 238 |
server_port=7860,
|
| 239 |
share=False,
|
| 240 |
show_api=False,
|
| 241 |
+
theme=gr.themes.Soft(),
|
| 242 |
+
css=CSS
|
| 243 |
)
|