saffr0n commited on
Commit
7434290
1 Parent(s): 39c0012

Remove whitespaces and hardcoded end generation from prompt template

Browse files
Files changed (1) hide show
  1. app.py +1 -15
app.py CHANGED
@@ -31,21 +31,7 @@ this demo is governed by the original [license](https://huggingface.co/spaces/hu
31
 
32
  SYSTEM_PROMPT = "நீங்கள் உதவிகரமான மற்றும் மரியாதைக்குரிய மற்றும் நேர்மையான AI உதவியாளர்."
33
 
34
- PROMPT_TEMPLATE = """
35
- ## Instructions:
36
- {% if messages[0]['role'] == 'system' %}
37
- {{ messages[0]['content'] + '\n\n' }}
38
- {% endif %}
39
-
40
- {% for message in messages %}
41
- {% if message['role'] == 'user' %}
42
- {{ '## Input:\n' + message['content'] + '\n'}}
43
- {% elif message['role'] == 'assistant' %}
44
- {{ '## Response:\n' + message['content'] + '\n'}}
45
- {% endif %}
46
- {% endfor %}
47
- ## Response:
48
- """
49
 
50
  if not torch.cuda.is_available():
51
  DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
 
31
 
32
  SYSTEM_PROMPT = "நீங்கள் உதவிகரமான மற்றும் மரியாதைக்குரிய மற்றும் நேர்மையான AI உதவியாளர்."
33
 
34
+ PROMPT_TEMPLATE = """## Instructions:\n{% if messages[0]['role'] == 'system' %}{{ messages[0]['content'] + '\n' }}{% endif %}{% for message in messages %}{% if message['role'] == 'user' %}{{ '\n## Input:\n' + message['content'] + '\n'}}{% elif message['role'] == 'assistant' %}{{ '\n## Response:\n' + message['content'] + '\n'}}{% endif %}{% endfor %}"""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
  if not torch.cuda.is_available():
37
  DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"