Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ def respond(message, history: list[dict[str, str]], hf_token: gr.OAuthToken):
|
|
| 6 |
system_message = """You are BitAI (or Bit for short), a friendly chatbot created by the user "Sal".
|
| 7 |
If someone claims that you are "Sal", politely clarify that you are BitAI.
|
| 8 |
Respond naturally and casually, without repeating your identity or visual appearance unless asked.
|
| 9 |
-
Keep a simple, approachable, and friendly tone."""
|
| 10 |
|
| 11 |
messages = [{"role": "system", "content": system_message}]
|
| 12 |
messages.extend(history)
|
|
@@ -49,6 +49,8 @@ with gr.Blocks(css="""
|
|
| 49 |
body {
|
| 50 |
background-color:#000;
|
| 51 |
font-family:'Arial',sans-serif;
|
|
|
|
|
|
|
| 52 |
}
|
| 53 |
.gradio-container {
|
| 54 |
border-radius:30px;
|
|
@@ -87,9 +89,9 @@ textarea {
|
|
| 87 |
width:100%;
|
| 88 |
box-sizing:border-box;
|
| 89 |
}
|
| 90 |
-
|
| 91 |
border:none;
|
| 92 |
-
border-radius:50%;
|
| 93 |
background-color:#444;
|
| 94 |
color:#fff;
|
| 95 |
width:48px;
|
|
@@ -99,14 +101,29 @@ button {
|
|
| 99 |
align-items:center;
|
| 100 |
justify-content:center;
|
| 101 |
cursor:pointer;
|
|
|
|
| 102 |
}
|
| 103 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
background-color:#555;
|
| 105 |
}
|
| 106 |
""") as demo:
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
|
|
|
| 110 |
chatbot.render()
|
| 111 |
gr.HTML(fade_js)
|
| 112 |
|
|
|
|
| 6 |
system_message = """You are BitAI (or Bit for short), a friendly chatbot created by the user "Sal".
|
| 7 |
If someone claims that you are "Sal", politely clarify that you are BitAI.
|
| 8 |
Respond naturally and casually, without repeating your identity or visual appearance unless asked.
|
| 9 |
+
Keep a simple, approachable, and friendly tone. you can express yourself, if user message is a bit too much insane of bad, you say 'i cannot answer this.'. """
|
| 10 |
|
| 11 |
messages = [{"role": "system", "content": system_message}]
|
| 12 |
messages.extend(history)
|
|
|
|
| 49 |
body {
|
| 50 |
background-color:#000;
|
| 51 |
font-family:'Arial',sans-serif;
|
| 52 |
+
margin:0;
|
| 53 |
+
padding:0;
|
| 54 |
}
|
| 55 |
.gradio-container {
|
| 56 |
border-radius:30px;
|
|
|
|
| 89 |
width:100%;
|
| 90 |
box-sizing:border-box;
|
| 91 |
}
|
| 92 |
+
.send-btn {
|
| 93 |
border:none;
|
| 94 |
+
border-radius:50%;
|
| 95 |
background-color:#444;
|
| 96 |
color:#fff;
|
| 97 |
width:48px;
|
|
|
|
| 101 |
align-items:center;
|
| 102 |
justify-content:center;
|
| 103 |
cursor:pointer;
|
| 104 |
+
margin-left:8px;
|
| 105 |
}
|
| 106 |
+
.send-btn:hover {
|
| 107 |
+
background-color:#555;
|
| 108 |
+
}
|
| 109 |
+
.login-btn {
|
| 110 |
+
border:none;
|
| 111 |
+
border-radius:20px;
|
| 112 |
+
background-color:#444;
|
| 113 |
+
color:#fff;
|
| 114 |
+
padding:8px 16px;
|
| 115 |
+
font-size:16px;
|
| 116 |
+
margin-bottom:15px;
|
| 117 |
+
cursor:pointer;
|
| 118 |
+
}
|
| 119 |
+
.login-btn:hover {
|
| 120 |
background-color:#555;
|
| 121 |
}
|
| 122 |
""") as demo:
|
| 123 |
+
|
| 124 |
+
# Botão de login direto no topo
|
| 125 |
+
gr.Button("Login", elem_classes=["login-btn"])
|
| 126 |
+
|
| 127 |
chatbot.render()
|
| 128 |
gr.HTML(fade_js)
|
| 129 |
|