Elron commited on
Commit
7e5d152
1 Parent(s): b7271da

Upload formats.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. formats.py +28 -16
formats.py CHANGED
@@ -35,23 +35,35 @@ class SystemFormat(Format):
35
 
36
  Example:
37
  when input instance:
38
- {
39
- "source": "1+1",
40
- "target": "2",
41
- "instruction": "Solve the math exercises.",
42
- "demos": [{"source": "1+2", "target": "3"}, {"source": "4-2", "target": "2"}]
43
- }
44
- is process-ed by
45
- system_format = SystemFormat(
46
- demos_field="demos",
47
- demo_format="Input: {source}\nOutput: {target}\n\n",
48
- model_input_format="Instruction: {instruction}\n\n{demos}Input: {source}\nOutput: ",
49
- )
 
 
 
 
 
 
 
 
50
  the resulting instance is:
51
- {
52
- "target": "2",
53
- "source": "Instruction: Solve the math exercises.\n\nInput: 1+2\nOutput: 3\n\nInput: 4-2\nOutput: 2\n\nInput: 1+1\nOutput: ",
54
- }
 
 
 
 
55
  """
56
 
57
  demos_field: str = "demos"
 
35
 
36
  Example:
37
  when input instance:
38
+
39
+ .. code-block::
40
+
41
+ {
42
+ "source": "1+1",
43
+ "target": "2",
44
+ "instruction": "Solve the math exercises.",
45
+ "demos": [{"source": "1+2", "target": "3"}, {"source": "4-2", "target": "2"}]
46
+ }
47
+
48
+ is processed by
49
+
50
+ .. code-block::
51
+
52
+ system_format = SystemFormat(
53
+ demos_field="demos",
54
+ demo_format="Input: {source}\nOutput: {target}\n\n",
55
+ model_input_format="Instruction: {instruction}\n\n{demos}Input: {source}\nOutput: ",
56
+ )
57
+
58
  the resulting instance is:
59
+
60
+ .. code-block::
61
+
62
+ {
63
+ "target": "2",
64
+ "source": "Instruction: Solve the math exercises.\n\nInput: 1+2\nOutput: 3\n\nInput: 4-2\nOutput: 2\n\nInput: 1+1\nOutput: ",
65
+ }
66
+
67
  """
68
 
69
  demos_field: str = "demos"