huangtao6 commited on
Commit
d93c64c
·
1 Parent(s): 7a33657

update readme

Browse files
Files changed (1) hide show
  1. README.md +0 -32
README.md CHANGED
@@ -12,38 +12,6 @@ LLaMAX is a multilingual language model, developed through continued pre-trainin
12
  Its translation capabilities far exceed general models of the same scale, and it can serve as a base model to support downstream multilingual tasks.
13
 
14
 
15
- ### 🔥 Effortless Multilingual Translation with a Simple Prompt
16
-
17
- LLaMAX supports translation between more than 100 languages, surpassing the performance of similarly scaled LLMs.
18
-
19
- ```angular2html
20
- def Prompt_template(query, src_language, trg_language):
21
- instruction = f'Translate the following sentences from {src_language} to {trg_language}.'
22
- prompt = (
23
- 'Below is an instruction that describes a task, paired with an input that provides further context. '
24
- 'Write a response that appropriately completes the request.\n'
25
- f'### Instruction:\n{instruction}\n'
26
- f'### Input:\n{query}\n### Response:'
27
- )
28
- return prompt
29
- ```
30
-
31
- And then run the following codes to execute translation:
32
- ```angular2html
33
- from transformers import AutoTokenizer, LlamaForCausalLM
34
-
35
- model = LlamaForCausalLM.from_pretrained(PATH_TO_CONVERTED_WEIGHTS)
36
- tokenizer = AutoTokenizer.from_pretrained(PATH_TO_CONVERTED_TOKENIZER)
37
-
38
- query = "你好,今天是个好日子"
39
- prompt = Prompt_template(query, 'Chinese', 'English')
40
- inputs = tokenizer(prompt, return_tensors="pt")
41
-
42
- generate_ids = model.generate(inputs.input_ids, max_length=30)
43
- tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0]
44
- # => "Hello, today is a good day"
45
- ```
46
-
47
  ### 🔥 Effective Base Model for Multilingual Task
48
 
49
  LLaMAX preserves its efficacy in general tasks and improves the performance on multilingual tasks.
 
12
  Its translation capabilities far exceed general models of the same scale, and it can serve as a base model to support downstream multilingual tasks.
13
 
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  ### 🔥 Effective Base Model for Multilingual Task
16
 
17
  LLaMAX preserves its efficacy in general tasks and improves the performance on multilingual tasks.