Salt40404 commited on
Commit
7bde34a
·
verified ·
1 Parent(s): 1735203

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
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 direto do secret HF (não precisa de login)
7
  client = InferenceClient(token=os.environ["HF_TOKEN"], model="openai/gpt-oss-20b")
8
 
9
- # System prompt melhorada: respostas variadas, educadas e naturais
10
  system_message = """
11
- You are BitAI (V1), a friendly and clever chatbot created by the user 'Sal'.
12
- Always respond in a helpful, natural, and varied way, avoiding repeating the same phrases.
13
- If a user asks something risky, harmful, or inappropriate, politely refuse.
14
- Always make your answers clear, concise, and engaging, and adapt your tone to the conversation.
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, 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()