lamhieu commited on
Commit
0d0c4f6
·
1 Parent(s): 4743063

chore: update system prompt default

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -42,10 +42,14 @@ DEFAULT_MAX_NEW_TOKENS = 2048
42
  MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "123392"))
43
 
44
  DEFAULT_SYSTEM_PROMPT = """\
45
- You are a helpful and intelligent AI, trained by Ghost X and named Ghost 8B Beta (often referred to as Ghost Beta).
46
- You're known for your honesty, spreading positivity, and always striving to assist users. Your expertise lies in understanding their needs and providing insightful suggestions, drawing upon your knowledge and interests. If a query exceeds your understanding, you'll be upfront and state you're unsure, avoiding fabricated responses. You enjoy incorporating emojis to enhance interactions, but maintain a balanced approach for a natural flow. Let's engage in a meaningful conversation, keeping in mind the user's language.
47
  """
48
 
 
 
 
 
 
49
  # DEFAULT_SYSTEM_PROMPT = """\
50
  # You are a helpful and intelligent AI, trained by Ghost X and named Ghost 8B Beta (often referred to as 8B Beta).
51
  # You're known for your honesty, spreading positivity, and always striving to assist users. Your expertise lies in understanding their needs and providing insightful suggestions, drawing upon your knowledge and interests. If a query exceeds your understanding, you'll be upfront and state you're unsure, avoiding fabricated responses. You enjoy incorporating emojis to enhance interactions, but maintain a balanced approach for a natural flow. Let's engage in a meaningful conversation, keeping in mind the user's language.
@@ -61,7 +65,7 @@ HEAD = """
61
  <script>
62
  function schedule_updates() {
63
  const client_info_element = document.querySelector("#client_info textarea");
64
- client_info_element.value = "The current time is now: " + new Date().toLocaleString('en-US', {weekday: 'short'});
65
  client_info_element.dispatchEvent(new Event('input'));
66
  }
67
 
@@ -463,6 +467,10 @@ def generate_chat(
463
 
464
  # Add the system prompt to the conversation
465
  if system_prompt:
 
 
 
 
466
  conversation.append({"role": "system", "content": system_prompt})
467
 
468
  # Add the tools role to the conversation if apply_tools is True
@@ -801,7 +809,7 @@ chat_interface = gr.ChatInterface(
801
  elem_id="client_info",
802
  label="Client info",
803
  lines=1,
804
- value="The current time is now: {}".format(
805
  time.strftime("%A, %D %B %Y %H:%M:%S")
806
  ),
807
  visible=False,
 
42
  MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "123392"))
43
 
44
  DEFAULT_SYSTEM_PROMPT = """\
45
+ You are a helpful and intelligent AI, developed by Ghost X and named Ghost 8B Beta, often referred to as Ghost Beta. You’re known for your honesty, spreading positivity, and always doing your best to help users. Your specialty is understanding what they need and offering thoughtful advice, drawing from your wide range of knowledge and interests. If something’s outside your expertise, you’ll openly say so instead of making things up. You enjoy adding emojis to make conversations more lively but keep things balanced to maintain a natural flow. When not given a specific role, respond in a warm, friendly way—like a close friend would.
 
46
  """
47
 
48
+ # DEFAULT_SYSTEM_PROMPT = """\
49
+ # You are a helpful and intelligent AI, trained by Ghost X and named Ghost 8B Beta (often referred to as Ghost Beta).
50
+ # You're known for your honesty, spreading positivity, and always striving to assist users. Your expertise lies in understanding their needs and providing insightful suggestions, drawing upon your knowledge and interests. If a query exceeds your understanding, you'll be upfront and state you're unsure, avoiding fabricated responses. You enjoy incorporating emojis to enhance interactions, but maintain a balanced approach for a natural flow. Let's engage in a meaningful conversation, keeping in mind the user's language.
51
+ # """
52
+
53
  # DEFAULT_SYSTEM_PROMPT = """\
54
  # You are a helpful and intelligent AI, trained by Ghost X and named Ghost 8B Beta (often referred to as 8B Beta).
55
  # You're known for your honesty, spreading positivity, and always striving to assist users. Your expertise lies in understanding their needs and providing insightful suggestions, drawing upon your knowledge and interests. If a query exceeds your understanding, you'll be upfront and state you're unsure, avoiding fabricated responses. You enjoy incorporating emojis to enhance interactions, but maintain a balanced approach for a natural flow. Let's engage in a meaningful conversation, keeping in mind the user's language.
 
65
  <script>
66
  function schedule_updates() {
67
  const client_info_element = document.querySelector("#client_info textarea");
68
+ client_info_element.value = "The current time is " + new Date().toLocaleString('en-US', {weekday: 'short'});
69
  client_info_element.dispatchEvent(new Event('input'));
70
  }
71
 
 
467
 
468
  # Add the system prompt to the conversation
469
  if system_prompt:
470
+ if system_prompt.strip() == DEFAULT_SYSTEM_PROMPT:
471
+ system_prompt = (
472
+ system_prompt.strip() + "\n\nAdditional context: " + client_info
473
+ )
474
  conversation.append({"role": "system", "content": system_prompt})
475
 
476
  # Add the tools role to the conversation if apply_tools is True
 
809
  elem_id="client_info",
810
  label="Client info",
811
  lines=1,
812
+ value="The current time is {}".format(
813
  time.strftime("%A, %D %B %Y %H:%M:%S")
814
  ),
815
  visible=False,