nishimura999 commited on
Commit
16e5704
1 Parent(s): 1984a50

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +19 -1
README.md CHANGED
@@ -21,4 +21,22 @@ datasets:
21
 
22
  This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
23
 
24
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
 
22
  This llama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
23
 
24
+ [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
25
+
26
+
27
+
28
+ ```python
29
+ # 例: Pythonコード
30
+ from transformers import AutoModelForCausalLM, AutoTokenizer
31
+
32
+ # モデルのロード
33
+ model = AutoModelForCausalLM.from_pretrained("model_name")
34
+ tokenizer = AutoTokenizer.from_pretrained("model_name")
35
+
36
+ # テキスト生成
37
+ input_text = "こんにちは、世界!"
38
+ inputs = tokenizer(input_text, return_tensors="pt")
39
+ outputs = model.generate(**inputs)
40
+ print(tokenizer.decode(outputs[0]))
41
+
42
+