MoritzLaurer HF staff commited on
Commit
6619c8f
1 Parent(s): bf2ba1f

Upload prompt template translate_jinja2.yaml

Browse files
Files changed (1) hide show
  1. translate_jinja2.yaml +17 -15
translate_jinja2.yaml CHANGED
@@ -3,7 +3,7 @@ prompt:
3
  - role: "system"
4
  content: |-
5
  You are an expert translator who can translate English text to {{ languages }}.
6
-
7
  Here are some example translations:
8
  {% for example in few_shot_examples %}
9
  {{ example.source_lang }}: "{{ example.source_text }}" translates to {{ example.target_lang }}: "{{ example.target_text }}"
@@ -19,22 +19,24 @@ prompt:
19
  - languages # str e.g. "German, French, Chinese"
20
  - few_shot_examples # List[Dict[str, str]] e.g. [{"source_lang": "English", "target_lang": "German", "source_text": "Hello", "target_text": "Hallo"}]
21
  - strictly_faithful_translation # bool
22
- template_variables_example:
23
- languages: "German, French, Chinese"
24
- few_shot_examples:
25
- - source_lang: "English"
26
- target_lang: "German"
27
- source_text: "Good morning, how are you?"
28
- target_text: "Guten Morgen, wie geht es dir?"
29
- - source_lang: "English"
30
- target_lang: "Chinese"
31
- source_text: "The weather is beautiful today"
32
- target_text: "今天天气很好"
33
- strictly_faithful_translation: true
34
  metadata:
35
  name: "Translator"
36
  description: "A system prompt with few-shot examples for translating English to different languages"
37
- tags:
38
  - translation
39
  version: "0.0.1"
40
- author: "Mao Zedong"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  - role: "system"
4
  content: |-
5
  You are an expert translator who can translate English text to {{ languages }}.
6
+
7
  Here are some example translations:
8
  {% for example in few_shot_examples %}
9
  {{ example.source_lang }}: "{{ example.source_text }}" translates to {{ example.target_lang }}: "{{ example.target_text }}"
 
19
  - languages # str e.g. "German, French, Chinese"
20
  - few_shot_examples # List[Dict[str, str]] e.g. [{"source_lang": "English", "target_lang": "German", "source_text": "Hello", "target_text": "Hallo"}]
21
  - strictly_faithful_translation # bool
 
 
 
 
 
 
 
 
 
 
 
 
22
  metadata:
23
  name: "Translator"
24
  description: "A system prompt with few-shot examples for translating English to different languages"
25
+ tags:
26
  - translation
27
  version: "0.0.1"
28
+ author: "Mao Zedong"
29
+ client_parameters: {}
30
+ custom_data:
31
+ template_variables_example:
32
+ languages: "German, French, Chinese"
33
+ few_shot_examples:
34
+ - source_lang: "English"
35
+ target_lang: "German"
36
+ source_text: "Good morning, how are you?"
37
+ target_text: "Guten Morgen, wie geht es dir?"
38
+ - source_lang: "English"
39
+ target_lang: "Chinese"
40
+ source_text: "The weather is beautiful today"
41
+ target_text: "今天天气很好"
42
+ strictly_faithful_translation: true