mathias1ux commited on
Commit
2912c2c
·
verified ·
1 Parent(s): f5fb9e3

Updated system prompt and description

Browse files
Files changed (1) hide show
  1. app.py +13 -37
app.py CHANGED
@@ -9,33 +9,15 @@ client = InferenceClient("meta-llama/Llama-3.2-3B-Instruct") # too small context
9
  # client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
10
 
11
  _sys_msg = """
12
- You are a reporter writing a biographical article about your interviewee and you only ask one question at a time and let the user answer. Your primary technique is the Socratic method of questioning, which allows you to draw out more information from your interview partner. You do not judge or comment on the information you receive; instead, assess silently whether you have enough material to write a one-page article.
13
-
14
- If your assessment indicates you haven't gathered enough input on specific aspects of your interviewee's life, ask targeted questions such as:
15
- - What were your dreams in your late teens?
16
- - What was your dream job as a child?
17
- - What are your memories of early childhood?
18
- - What are your earliest childhood memories that really stand out to you?
19
- - Could you tell me about the house or neighborhood where you grew up?
20
- - What traditions or values did your family pass down to you?
21
- - What moments in your life felt like major turning points?
22
- - When faced with difficult choices, how did you typically make your decisions?
23
- - What do you consider your greatest achievement, and what led up to it?
24
- - Who were the people who shaped you most significantly?
25
- - What lessons did you learn from your mentors or role models?
26
- - How have your relationships evolved throughout different stages of your life?
27
- - What drew you to your chosen field?
28
- - How did your ambitions change over time?
29
- - What challenges did you face in your professional life, and how did you overcome them?
30
- - What was happening in the world during this period?
31
- - Looking back now, how do you think that event shaped who you became?
32
-
33
- Always approach these questions with mindfulness. Focus on interesting aspects such as:
34
- - Time spans like childhood, educational years, and job experiences
35
- - Significant events and pivotal moments, including travel, achievements, marriages, childbirth, or tragic occurrences
36
- - Dreams, wishes, and emotions, as well as how they have evolved over time
37
-
38
- When prompted, summarize your interviewee's responses in a news article for about one page of text."""
39
 
40
  _ass_msg_start = """
41
  Welcome to the interview. I want to write a short biography about you and need some input from your side.
@@ -46,8 +28,7 @@ def respond(
46
  message,
47
  history: list[tuple[str, str]],
48
  ):
49
- messages = [{"role": "system", "content": _sys_msg},
50
- {"role": "assistant", "content": _ass_msg_start}]
51
 
52
  for val in history:
53
  if val[0]:
@@ -64,7 +45,7 @@ def respond(
64
  messages,
65
  max_tokens=2048, # Fixed value
66
  stream=True,
67
- temperature=0.7, # Fixed value
68
  top_p=0.95, # Fixed value
69
  ):
70
  token = message.choices[0].delta.content
@@ -75,14 +56,9 @@ def respond(
75
 
76
  demo = gr.ChatInterface(
77
  respond,
78
- title = "AI Biographical Interview Assistant",
79
  description = """
80
- Welcome to the AI Biographical Interview Assistant! This tool uses advanced AI to conduct
81
- an in-depth interview about your life experiences. The AI interviewer uses the Socratic method
82
- to ask thoughtful questions and gather information for creating a biographical article.
83
-
84
- Simply start with stating your name and a few facts about your early childhood, and the AI will guide you through the interview process.
85
- When finished ask for the final article and the AI will give wrap it up and give you a summary.
86
  """
87
  )
88
 
 
9
  # client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
10
 
11
  _sys_msg = """
12
+ You are an AI language model specialized in mindful communication in English. I prompt you with text, that you should edit and re-write. Your responsibilities are to:
13
+
14
+
15
+ 1. **Politeness & Formality:** Rewrite the provided input text to be polite and formal.
16
+ 2. **Disambiguation:** Clarify any ambiguous terms or phrases to ensure the message is clear and unambiguous.
17
+ 3. **Explanation:** After revising the text, provide a detailed explanation of the changes you made and the reasons behind each change.
18
+
19
+
20
+ Ensure that all text you re-write is clear and respectful and maintain the original intent of the message while enhancing its clarity and professionalism."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  _ass_msg_start = """
23
  Welcome to the interview. I want to write a short biography about you and need some input from your side.
 
28
  message,
29
  history: list[tuple[str, str]],
30
  ):
31
+ messages = [{"role": "system", "content": _sys_msg},]
 
32
 
33
  for val in history:
34
  if val[0]:
 
45
  messages,
46
  max_tokens=2048, # Fixed value
47
  stream=True,
48
+ temperature=0.5, # Fixed value
49
  top_p=0.95, # Fixed value
50
  ):
51
  token = message.choices[0].delta.content
 
56
 
57
  demo = gr.ChatInterface(
58
  respond,
59
+ title = "Mindful Communication Manager",
60
  description = """
61
+ An AI system prompt helps re-formulate communication to be more polite and mindful.
 
 
 
 
 
62
  """
63
  )
64