Update app.py
Browse files
app.py
CHANGED
|
@@ -3,10 +3,12 @@ from huggingface_hub import InferenceClient
|
|
| 3 |
|
| 4 |
def respond(message, history: list[dict[str, str]], hf_token: gr.OAuthToken):
|
| 5 |
client = InferenceClient(token=hf_token.token, model="openai/gpt-oss-20b")
|
|
|
|
| 6 |
system_message = """You are BitAI (or Bit for short), a friendly chatbot created by the user "Sal".
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
messages = [{"role": "system", "content": system_message}]
|
| 12 |
messages.extend(history)
|
|
@@ -53,7 +55,7 @@ body {
|
|
| 53 |
padding:0;
|
| 54 |
}
|
| 55 |
.gradio-container {
|
| 56 |
-
border-radius:
|
| 57 |
padding:20px;
|
| 58 |
max-width:700px;
|
| 59 |
margin:30px auto;
|
|
@@ -61,7 +63,7 @@ body {
|
|
| 61 |
box-shadow:0 6px 25px rgba(0,0,0,0.3);
|
| 62 |
}
|
| 63 |
.chat-message {
|
| 64 |
-
border-radius:
|
| 65 |
padding:14px 18px;
|
| 66 |
margin:8px 0;
|
| 67 |
display:flex;
|
|
@@ -81,7 +83,7 @@ body {
|
|
| 81 |
textarea {
|
| 82 |
border:none;
|
| 83 |
outline:none;
|
| 84 |
-
border-radius:
|
| 85 |
padding:12px;
|
| 86 |
background-color:#1a1a1a;
|
| 87 |
color:#fff;
|
|
@@ -91,7 +93,7 @@ textarea {
|
|
| 91 |
}
|
| 92 |
.send-btn {
|
| 93 |
border:none;
|
| 94 |
-
border-radius:
|
| 95 |
background-color:#444;
|
| 96 |
color:#fff;
|
| 97 |
width:48px;
|
|
@@ -108,7 +110,7 @@ textarea {
|
|
| 108 |
}
|
| 109 |
/* login button default Gradio */
|
| 110 |
.gr-button.gr-login {
|
| 111 |
-
border-radius:
|
| 112 |
background-color:#444 !important;
|
| 113 |
color:#fff !important;
|
| 114 |
margin-bottom:15px;
|
|
|
|
| 3 |
|
| 4 |
def respond(message, history: list[dict[str, str]], hf_token: gr.OAuthToken):
|
| 5 |
client = InferenceClient(token=hf_token.token, model="openai/gpt-oss-20b")
|
| 6 |
+
|
| 7 |
system_message = """You are BitAI (or Bit for short), a friendly chatbot created by the user "Sal".
|
| 8 |
+
You always respond politely and helpfully. If a user requests something appropriate, fulfill it.
|
| 9 |
+
If a user requests something harmful, illegal, or inappropriate, politely refuse.
|
| 10 |
+
If a user keeps insisting on harmful requests, firmly tell them to stop and that they cannot use the service for that purpose.
|
| 11 |
+
Keep a simple, approachable, and friendly tone otherwise."""
|
| 12 |
|
| 13 |
messages = [{"role": "system", "content": system_message}]
|
| 14 |
messages.extend(history)
|
|
|
|
| 55 |
padding:0;
|
| 56 |
}
|
| 57 |
.gradio-container {
|
| 58 |
+
border-radius:45px;
|
| 59 |
padding:20px;
|
| 60 |
max-width:700px;
|
| 61 |
margin:30px auto;
|
|
|
|
| 63 |
box-shadow:0 6px 25px rgba(0,0,0,0.3);
|
| 64 |
}
|
| 65 |
.chat-message {
|
| 66 |
+
border-radius:45px;
|
| 67 |
padding:14px 18px;
|
| 68 |
margin:8px 0;
|
| 69 |
display:flex;
|
|
|
|
| 83 |
textarea {
|
| 84 |
border:none;
|
| 85 |
outline:none;
|
| 86 |
+
border-radius:45px;
|
| 87 |
padding:12px;
|
| 88 |
background-color:#1a1a1a;
|
| 89 |
color:#fff;
|
|
|
|
| 93 |
}
|
| 94 |
.send-btn {
|
| 95 |
border:none;
|
| 96 |
+
border-radius:45px;
|
| 97 |
background-color:#444;
|
| 98 |
color:#fff;
|
| 99 |
width:48px;
|
|
|
|
| 110 |
}
|
| 111 |
/* login button default Gradio */
|
| 112 |
.gr-button.gr-login {
|
| 113 |
+
border-radius:45px !important;
|
| 114 |
background-color:#444 !important;
|
| 115 |
color:#fff !important;
|
| 116 |
margin-bottom:15px;
|