QAway-to
commited on
Commit
·
893dddd
1
Parent(s):
1c31761
New Prompt+Instcrution
Browse filesChange Config: rise temp, low repeat_pen
- core/interviewer.py +26 -8
core/interviewer.py
CHANGED
|
@@ -29,14 +29,32 @@ print(f"Device set to use {device}")
|
|
| 29 |
# --------------------------------------------------------------
|
| 30 |
# 2️⃣ Seed-промпты (без инструкций)
|
| 31 |
# --------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
PROMPTS = [
|
| 33 |
-
"
|
| 34 |
-
"
|
| 35 |
-
"
|
| 36 |
-
"
|
| 37 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
]
|
| 39 |
|
|
|
|
| 40 |
# --------------------------------------------------------------
|
| 41 |
# 3️⃣ Очистка текста
|
| 42 |
# --------------------------------------------------------------
|
|
@@ -66,9 +84,9 @@ def generate_question(user_id: str = "default_user", **kwargs) -> str:
|
|
| 66 |
**inputs,
|
| 67 |
do_sample=True,
|
| 68 |
top_p=0.9,
|
| 69 |
-
temperature=
|
| 70 |
-
repetition_penalty=1.
|
| 71 |
-
max_new_tokens=
|
| 72 |
)
|
| 73 |
text = tokenizer.decode(out[0], skip_special_tokens=True)
|
| 74 |
return _clean_question(text)
|
|
|
|
| 29 |
# --------------------------------------------------------------
|
| 30 |
# 2️⃣ Seed-промпты (без инструкций)
|
| 31 |
# --------------------------------------------------------------
|
| 32 |
+
|
| 33 |
+
# --------------------------------------------------------------
|
| 34 |
+
# 2️⃣ Тематические seed-промпты (по осям MBTI, но без прямого упоминания MBTI)
|
| 35 |
+
# --------------------------------------------------------------
|
| 36 |
+
|
| 37 |
+
BASE_INSTRUCTION = (
|
| 38 |
+
"Generate one natural, open-ended question about human thinking, emotions, or decision-making. "
|
| 39 |
+
"Avoid mentioning MBTI or personality types directly. "
|
| 40 |
+
"Do not ask what type the person belongs to. "
|
| 41 |
+
"You may include ideas related to intuition, logic, feelings, perception, or judgment naturally."
|
| 42 |
+
)
|
| 43 |
+
|
| 44 |
PROMPTS = [
|
| 45 |
+
f"{BASE_INSTRUCTION} Explore how people usually recharge their energy and interact with others.",
|
| 46 |
+
f"{BASE_INSTRUCTION} Explore the difference between noticing small details and seeing the bigger picture.",
|
| 47 |
+
f"{BASE_INSTRUCTION} Ask about trusting intuition versus relying on concrete evidence in daily life.",
|
| 48 |
+
f"{BASE_INSTRUCTION} Ask about what typically inspires or motivates someone to take action.",
|
| 49 |
+
f"{BASE_INSTRUCTION} Create a question about balancing emotions and logic when making decisions.",
|
| 50 |
+
f"{BASE_INSTRUCTION} Write about preferences between careful planning and spontaneous action.",
|
| 51 |
+
f"{BASE_INSTRUCTION} Explore how individuals deal with uncertainty or unexpected changes.",
|
| 52 |
+
f"{BASE_INSTRUCTION} Ask about understanding other people’s emotions or empathy in relationships.",
|
| 53 |
+
f"{BASE_INSTRUCTION} Create a question about staying organized versus adapting flexibly to new situations.",
|
| 54 |
+
f"{BASE_INSTRUCTION} Explore curiosity, creativity, and how people find meaning in what they do."
|
| 55 |
]
|
| 56 |
|
| 57 |
+
|
| 58 |
# --------------------------------------------------------------
|
| 59 |
# 3️⃣ Очистка текста
|
| 60 |
# --------------------------------------------------------------
|
|
|
|
| 84 |
**inputs,
|
| 85 |
do_sample=True,
|
| 86 |
top_p=0.9,
|
| 87 |
+
temperature=1.1,
|
| 88 |
+
repetition_penalty=1.2,
|
| 89 |
+
max_new_tokens=80,
|
| 90 |
)
|
| 91 |
text = tokenizer.decode(out[0], skip_special_tokens=True)
|
| 92 |
return _clean_question(text)
|