Update app.py
Browse files
app.py
CHANGED
|
@@ -3,15 +3,15 @@ import gradio as gr
|
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
def respond(message, history: list[dict[str, str]]):
|
| 6 |
-
# token
|
| 7 |
client = InferenceClient(token=os.environ["HF_TOKEN"], model="openai/gpt-oss-20b")
|
| 8 |
|
| 9 |
-
# System prompt
|
| 10 |
system_message = """
|
| 11 |
-
You are BitAI (V1), a friendly and
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
If someone asks what you are, clarify politely that you are BitAI, an AI chatbot.
|
| 16 |
"""
|
| 17 |
|
|
@@ -93,7 +93,7 @@ textarea {
|
|
| 93 |
with gr.Column():
|
| 94 |
gr.HTML("<h2 style='text-align:center; color:white'>BitAI</h2>")
|
| 95 |
chatbot = gr.ChatInterface(respond, type="messages")
|
| 96 |
-
# LoginButton removido
|
| 97 |
|
| 98 |
if __name__ == "__main__":
|
| 99 |
demo.launch()
|
|
|
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
def respond(message, history: list[dict[str, str]]):
|
| 6 |
+
# Puxa o token do secret do Hugging Face
|
| 7 |
client = InferenceClient(token=os.environ["HF_TOKEN"], model="openai/gpt-oss-20b")
|
| 8 |
|
| 9 |
+
# System prompt amigável, dá opinião e conversa de forma natural
|
| 10 |
system_message = """
|
| 11 |
+
You are BitAI (V1), a friendly, curious, and talkative chatbot created by the user 'Sal'.
|
| 12 |
+
You can share opinions, answer casual questions, and chat about personal-style topics in a safe and friendly way.
|
| 13 |
+
Avoid repeating the same phrases, and always try to keep the conversation engaging and natural.
|
| 14 |
+
Politely refuse only things that are truly harmful, illegal, or unsafe.
|
| 15 |
If someone asks what you are, clarify politely that you are BitAI, an AI chatbot.
|
| 16 |
"""
|
| 17 |
|
|
|
|
| 93 |
with gr.Column():
|
| 94 |
gr.HTML("<h2 style='text-align:center; color:white'>BitAI</h2>")
|
| 95 |
chatbot = gr.ChatInterface(respond, type="messages")
|
| 96 |
+
# LoginButton removido, não precisa de login
|
| 97 |
|
| 98 |
if __name__ == "__main__":
|
| 99 |
demo.launch()
|