Update README.md
Browse files
README.md
CHANGED
|
@@ -21,14 +21,15 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 21 |
tokenizer = AutoTokenizer.from_pretrained("stockmark/stockmark-100b")
|
| 22 |
model = AutoModelForCausalLM.from_pretrained("stockmark/stockmark-100b", device_map="auto", torch_dtype=torch.bfloat16)
|
| 23 |
|
| 24 |
-
input_ids = tokenizer("
|
| 25 |
with torch.inference_mode():
|
| 26 |
tokens = model.generate(
|
| 27 |
input_ids,
|
| 28 |
max_new_tokens = 256,
|
| 29 |
do_sample = True,
|
| 30 |
-
temperature = 0.
|
| 31 |
-
top_p = 0.95
|
|
|
|
| 32 |
)
|
| 33 |
|
| 34 |
output = tokenizer.decode(tokens[0], skip_special_tokens=True)
|
|
|
|
| 21 |
tokenizer = AutoTokenizer.from_pretrained("stockmark/stockmark-100b")
|
| 22 |
model = AutoModelForCausalLM.from_pretrained("stockmark/stockmark-100b", device_map="auto", torch_dtype=torch.bfloat16)
|
| 23 |
|
| 24 |
+
input_ids = tokenizer("生成AIとは?", return_tensors="pt").input_ids.to(model.device)
|
| 25 |
with torch.inference_mode():
|
| 26 |
tokens = model.generate(
|
| 27 |
input_ids,
|
| 28 |
max_new_tokens = 256,
|
| 29 |
do_sample = True,
|
| 30 |
+
temperature = 0.7,
|
| 31 |
+
top_p = 0.95,
|
| 32 |
+
repetition_penalty = 1.08
|
| 33 |
)
|
| 34 |
|
| 35 |
output = tokenizer.decode(tokens[0], skip_special_tokens=True)
|