umisetokikaze commited on
Commit
0e361ea
β€’
1 Parent(s): d36005a

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +35 -1
README.md CHANGED
@@ -52,5 +52,39 @@ We would like to take this opportunity to thank
52
  - BAD: あγͺγŸγ―β—‹β—‹γŒγ§γγΎγ™
53
  - GOOD: あγͺγŸγ―β—‹β—‹γ‚’γ—γΎγ™
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  ## Other points to keep in mind
56
- If possible, we recommend inferring with llamacpp rather than Transformers.
 
 
 
 
52
  - BAD: あγͺγŸγ―β—‹β—‹γŒγ§γγΎγ™
53
  - GOOD: あγͺγŸγ―β—‹β—‹γ‚’γ—γΎγ™
54
 
55
+ ## Performing inference
56
+
57
+ ```python
58
+ from transformers import AutoModelForCausalLM, AutoTokenizer
59
+
60
+ model = AutoModelForCausalLM.from_pretrained("Local-Novel-LLM-project/Ninja-v1-128k", trust_remote_code=True)
61
+ tokenizer = AutoTokenizer.from_pretrained("Local-Novel-LLM-project/Ninja-v1-128k")
62
+
63
+ prompt = "Once upon a time,"
64
+ input_ids = tokenizer.encode(prompt, return_tensors="pt")
65
+
66
+ output = model.generate(input_ids, max_length=100, do_sample=True)
67
+ generated_text = tokenizer.decode(output)
68
+
69
+ print(generated_text)
70
+ ````
71
+
72
+ ## Merge recipe
73
+
74
+ - WizardLM2 - mistralai/Mistral-7B-v0.1
75
+ - NousResearch/Yarn-Mistral-7b-128k - mistralai/Mistral-7B-v0.1
76
+ - Elizezen/Antler-7B - stabilityai/japanese-stablelm-instruct-gamma-7b
77
+ - NTQAI/chatntq-ja-7b-v1.0
78
+
79
+ The characteristics of each model are as follows.
80
+
81
+ - WizardLM2: High quality multitasking model
82
+ - Yarn-Mistral-7b-128k: Mistral model with 128k context window
83
+ - Antler-7B: Model specialized for novel writing
84
+ - NTQAI/chatntq-ja-7b-v1.0 High quality Japanese specialized model
85
+
86
  ## Other points to keep in mind
87
+ - The training data may be biased. Be careful with the generated sentences.
88
+ - Set trust_remote_code to True for context expansion with YaRN.
89
+ - Memory usage may be large for long inferences.
90
+ - If possible, we recommend inferring with llamacpp rather than Transformers.