Jofthomas HF staff commited on
Commit
aaadcd8
1 Parent(s): 9198ac8

Update TextGen/router.py

Browse files
Files changed (1) hide show
  1. TextGen/router.py +5 -2
TextGen/router.py CHANGED
@@ -49,9 +49,12 @@ class Generate(BaseModel):
49
 
50
  def generate_text(messages: List[str], npc:str):
51
  print(npc)
52
- system_prompt=main_npc_system_prompts[npc]
 
 
 
53
  print(system_prompt)
54
- new_messages=[{"role": "system", "content": system_prompt}]
55
  for index, message in enumerate(messages):
56
  if index%2==0:
57
  new_messages.append({"role": "user", "content": message})
 
49
 
50
  def generate_text(messages: List[str], npc:str):
51
  print(npc)
52
+ if npc in main_npcs:
53
+ system_prompt=main_npc_system_prompts[npc]
54
+ else:
55
+ system_prompt="you're a character in a video game. Play along."
56
  print(system_prompt)
57
+ new_messages=[{"role": "user", "content": system_prompt}]
58
  for index, message in enumerate(messages):
59
  if index%2==0:
60
  new_messages.append({"role": "user", "content": message})