Spaces:
Running
Running
Upload app.py
Browse files
app.py
CHANGED
|
@@ -154,6 +154,12 @@ custom_css = """
|
|
| 154 |
border-radius: 10px !important;
|
| 155 |
margin: 0 !important;
|
| 156 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
.api-background {
|
| 158 |
background-color: #FFCFB3 !important;
|
| 159 |
padding: 10px !important;
|
|
@@ -162,6 +168,14 @@ custom_css = """
|
|
| 162 |
}
|
| 163 |
.custom-button {
|
| 164 |
border-radius: 10px !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
}
|
| 166 |
.pink-bg {
|
| 167 |
background-color: #ff4081 !important;
|
|
@@ -189,12 +203,6 @@ custom_css = """
|
|
| 189 |
|
| 190 |
with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as demo:
|
| 191 |
gr.Markdown("# 👹 Multi-Chain Reasoning using Llama-3.1-405B-Instruct. Deployed by 江信宗", elem_classes="center-aligned")
|
| 192 |
-
|
| 193 |
-
with gr.Row():
|
| 194 |
-
model = gr.Dropdown(choices=MODELS, label="選擇模型", value=MODELS[0], elem_classes="input-background")
|
| 195 |
-
thinking_budget = gr.Slider(minimum=1, maximum=100, value=20, step=1, label="思維規劃", info="模型所能進行的最大思考次數", elem_classes="input-background")
|
| 196 |
-
api_key = gr.Textbox(label="API Key", type="password", placeholder="API authentication key for large language models", elem_classes="api-background")
|
| 197 |
-
|
| 198 |
chatbot = gr.Chatbot(
|
| 199 |
label="Chat",
|
| 200 |
show_label=False,
|
|
@@ -207,7 +215,11 @@ with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as demo:
|
|
| 207 |
elem_classes=["user-message", "assistant-message"],
|
| 208 |
container=True
|
| 209 |
)
|
| 210 |
-
msg = gr.Textbox(label="請輸入您的問題:", placeholder="輸入完成後直接按 Enter 開始執行......", elem_classes="pink-bg"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
clear_button = gr.Button("清除聊天記錄", elem_classes="custom-button")
|
| 212 |
clear_button.click(
|
| 213 |
lambda: ([], "", gr.Info("已成功清除聊天記錄,請繼續提問......")),
|
|
@@ -223,4 +235,4 @@ if __name__ == "__main__":
|
|
| 223 |
if "SPACE_ID" in os.environ:
|
| 224 |
demo.launch()
|
| 225 |
else:
|
| 226 |
-
demo.launch(share=True, show_api=False)
|
|
|
|
| 154 |
border-radius: 10px !important;
|
| 155 |
margin: 0 !important;
|
| 156 |
}
|
| 157 |
+
.input-background textarea {
|
| 158 |
+
font-size: 18px !important;
|
| 159 |
+
background-color: #ffffff;
|
| 160 |
+
border: 1px solid #f0f8ff;
|
| 161 |
+
border-radius: 8px;
|
| 162 |
+
}
|
| 163 |
.api-background {
|
| 164 |
background-color: #FFCFB3 !important;
|
| 165 |
padding: 10px !important;
|
|
|
|
| 168 |
}
|
| 169 |
.custom-button {
|
| 170 |
border-radius: 10px !important;
|
| 171 |
+
background-color: #333333 !important;
|
| 172 |
+
color: white !important;
|
| 173 |
+
font-weight: bold !important;
|
| 174 |
+
transition: all 0.3s ease !important;
|
| 175 |
+
}
|
| 176 |
+
.custom-button {
|
| 177 |
+
background-color: #000000 !important;
|
| 178 |
+
transform: scale(1.05);
|
| 179 |
}
|
| 180 |
.pink-bg {
|
| 181 |
background-color: #ff4081 !important;
|
|
|
|
| 203 |
|
| 204 |
with gr.Blocks(theme=gr.themes.Monochrome(), css=custom_css) as demo:
|
| 205 |
gr.Markdown("# 👹 Multi-Chain Reasoning using Llama-3.1-405B-Instruct. Deployed by 江信宗", elem_classes="center-aligned")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 206 |
chatbot = gr.Chatbot(
|
| 207 |
label="Chat",
|
| 208 |
show_label=False,
|
|
|
|
| 215 |
elem_classes=["user-message", "assistant-message"],
|
| 216 |
container=True
|
| 217 |
)
|
| 218 |
+
msg = gr.Textbox(label="請輸入您的問題:", placeholder="輸入完成後直接按 Enter 開始執行......", autofocus=True, max_lines=10, elem_classes="pink-bg")
|
| 219 |
+
with gr.Row():
|
| 220 |
+
model = gr.Dropdown(choices=MODELS, label="選擇模型", value=MODELS[0], elem_classes="input-background")
|
| 221 |
+
thinking_budget = gr.Slider(minimum=1, maximum=100, value=20, step=1, label="思維規劃", info="模型所能進行的最大思考次數", elem_classes="input-background")
|
| 222 |
+
api_key = gr.Textbox(label="API Key", type="password", placeholder="API authentication key for large language models", elem_classes="api-background")
|
| 223 |
clear_button = gr.Button("清除聊天記錄", elem_classes="custom-button")
|
| 224 |
clear_button.click(
|
| 225 |
lambda: ([], "", gr.Info("已成功清除聊天記錄,請繼續提問......")),
|
|
|
|
| 235 |
if "SPACE_ID" in os.environ:
|
| 236 |
demo.launch()
|
| 237 |
else:
|
| 238 |
+
demo.launch(share=True, show_api=False)
|