Chris STC commited on
Commit
5d66ab0
·
1 Parent(s): bc3b29d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -35,15 +35,15 @@ with gr.Blocks(theme=theme) as demo:
35
  instruction = history[-1][1] or ""
36
  user_message = history[-1][0]
37
 
38
- token_instruction_header = b"### Instruction: "
39
- token_instruction_text = instruction.encode()
40
 
41
- token_user_header = b"\n\n### User: "
42
- token_user_text = user_message.encode()
43
 
44
- token_response_header = b"\n\n### Response:"
45
 
46
- tokens = llm2.tokenize(token_instruction_header + token_instruction_text + token_user_header + token_user_text + token_response_header)
47
 
48
  history[-1][1] = ""
49
  count = 0
 
35
  instruction = history[-1][1] or ""
36
  user_message = history[-1][0]
37
 
38
+ token_instruction_header = llm2.tokenize(b"### Instruction: ")
39
+ token_instruction_text = llm2.tokenize(instruction.encode()
40
 
41
+ token_user_header = llm2.tokenize(b"\n\n### User: ")
42
+ token_user_text = llm2.tokenize(user_message.encode())
43
 
44
+ token_response_header = llm2.tokenize(b"\n\n### Response:")
45
 
46
+ tokens = token_instruction_header + token_instruction_text + token_user_header + token_user_text + token_response_header
47
 
48
  history[-1][1] = ""
49
  count = 0