Chris4K commited on
Commit
a461fb5
·
verified ·
1 Parent(s): 1b2d47e

Update generator.py

Browse files
Files changed (1) hide show
  1. generator.py +2 -2
generator.py CHANGED
@@ -2,9 +2,9 @@ from transformers import pipeline
2
 
3
 
4
 
5
- def format(self, context) -> str:
6
  system_message = f"You are an expert in writing novels. You have won many prices."
7
- user_message = f"Please assist based on the following context: {context}"
8
  prompt = f"<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n{system_message}<|eot_id|>"
9
  prompt += f"<|start_header_id|>user<|end_header_id|>\n\n{user_input}<|eot_id|>"
10
  prompt += "<|start_header_id|>assistant<|end_header_id|>\n\n"
 
2
 
3
 
4
 
5
+ def format(self, text) -> str:
6
  system_message = f"You are an expert in writing novels. You have won many prices."
7
+ user_message = f"Please assist based on the following context: {text}"
8
  prompt = f"<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n{system_message}<|eot_id|>"
9
  prompt += f"<|start_header_id|>user<|end_header_id|>\n\n{user_input}<|eot_id|>"
10
  prompt += "<|start_header_id|>assistant<|end_header_id|>\n\n"