[Docs] Add language identifiers to fenced code blocks (#28955)
Add language identifiers to code blocks
This commit is contained in:
@@ -215,7 +215,7 @@ LLM(Language Model)はさまざまな入力形式を処理できるほどス
|
||||
|
||||
If you like this one, here it is in one-liner form, ready to copy into your code:
|
||||
|
||||
```
|
||||
```python
|
||||
tokenizer.chat_template = "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}"
|
||||
```
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ Assistant:
|
||||
|
||||
したがって、カスタム`chat`プロンプトテンプレートの例もこのフォーマットを使用することが重要です。以下のように、インスタンス化時に`chat`テンプレートを上書きできます。
|
||||
|
||||
```
|
||||
```python
|
||||
template = """ [...] """
|
||||
|
||||
agent = HfAgent(url_endpoint=your_endpoint, chat_prompt_template=template)
|
||||
|
||||
@@ -2202,7 +2202,7 @@ print(f"rank{rank}:\n in={text_in}\n out={text_out}")
|
||||
|
||||
それを`t0.py`として保存して実行しましょう。
|
||||
|
||||
```
|
||||
```bash
|
||||
$ deepspeed --num_gpus 2 t0.py
|
||||
rank0:
|
||||
in=Is this review positive or negative? Review: this is the best cast iron skillet you will ever buy
|
||||
@@ -2226,13 +2226,13 @@ DeepSpeed 統合を含む PR を送信する場合は、CircleCI PR CI セット
|
||||
|
||||
DeepSpeed テストを実行するには、少なくとも以下を実行してください。
|
||||
|
||||
```
|
||||
```bash
|
||||
RUN_SLOW=1 pytest tests/deepspeed/test_deepspeed.py
|
||||
```
|
||||
|
||||
モデリングまたは pytorch サンプル コードのいずれかを変更した場合は、Model Zoo テストも実行します。以下はすべての DeepSpeed テストを実行します。
|
||||
|
||||
```
|
||||
```bash
|
||||
RUN_SLOW=1 pytest tests/deepspeed
|
||||
```
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ GPUが重要な負荷の下でどのような温度を目指すべきかを正
|
||||
複数のGPUを使用する場合、カードの相互接続方法はトータルのトレーニング時間に大きな影響を与える可能性があります。GPUが同じ物理ノードにある場合、次のように実行できます:
|
||||
|
||||
|
||||
```
|
||||
```bash
|
||||
nvidia-smi topo -m
|
||||
```
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ model = AutoModelForImageClassification.from_pretrained(MODEL_ID).to("cuda")
|
||||
|
||||
### Image Classification with ViT
|
||||
|
||||
```
|
||||
```python
|
||||
from PIL import Image
|
||||
import requests
|
||||
import numpy as np
|
||||
|
||||
@@ -36,7 +36,7 @@ IPEXのリリースはPyTorchに従っており、pipを使用してインスト
|
||||
| 1.11 | 1.11.200+cpu |
|
||||
| 1.10 | 1.10.100+cpu |
|
||||
|
||||
```
|
||||
```bash
|
||||
pip install intel_extension_for_pytorch==<version_name> -f https://developer.intel.com/ipex-whl-stable-cpu
|
||||
```
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ Wheelファイルは、以下のPythonバージョン用に利用可能です:
|
||||
| 1.11.0 | | √ | √ | √ | √ |
|
||||
| 1.10.0 | √ | √ | √ | √ | |
|
||||
|
||||
```
|
||||
```bash
|
||||
pip install oneccl_bind_pt=={pytorch_version} -f https://developer.intel.com/ipex-whl-stable-cpu
|
||||
```
|
||||
|
||||
@@ -70,13 +70,13 @@ oneccl_bindings_for_pytorchはMPIツールセットと一緒にインストー
|
||||
|
||||
|
||||
for Intel® oneCCL >= 1.12.0
|
||||
```
|
||||
```bash
|
||||
oneccl_bindings_for_pytorch_path=$(python -c "from oneccl_bindings_for_pytorch import cwd; print(cwd)")
|
||||
source $oneccl_bindings_for_pytorch_path/env/setvars.sh
|
||||
```
|
||||
|
||||
for Intel® oneCCL whose version < 1.12.0
|
||||
```
|
||||
```bash
|
||||
torch_ccl_path=$(python -c "import torch; import torch_ccl; import os; print(os.path.abspath(os.path.dirname(torch_ccl.__file__)))")
|
||||
source $torch_ccl_path/env/setvars.sh
|
||||
```
|
||||
|
||||
@@ -131,7 +131,7 @@ DPとDDPの他にも違いがありますが、この議論には関係ありま
|
||||
`NCCL_P2P_DISABLE=1`を使用して、対応するベンチマークでNVLink機能を無効にしました。
|
||||
|
||||
|
||||
```
|
||||
```bash
|
||||
|
||||
# DP
|
||||
rm -r /tmp/test-clm; CUDA_VISIBLE_DEVICES=0,1 \
|
||||
|
||||
@@ -151,7 +151,7 @@ training_args = TrainingArguments(bf16=True, **default_args)
|
||||
|
||||
アンペアハードウェアは、tf32という特別なデータ型を使用します。これは、fp32と同じ数値範囲(8ビット)を持っていますが、23ビットの精度ではなく、10ビットの精度(fp16と同じ)を持ち、合計で19ビットしか使用しません。これは通常のfp32トレーニングおよび推論コードを使用し、tf32サポートを有効にすることで、最大3倍のスループットの向上が得られる点で「魔法のよう」です。行う必要があるのは、次のコードを追加するだけです:
|
||||
|
||||
```
|
||||
```python
|
||||
import torch
|
||||
torch.backends.cuda.matmul.allow_tf32 = True
|
||||
torch.backends.cudnn.allow_tf32 = True
|
||||
|
||||
@@ -490,7 +490,7 @@ def compute_metrics(eval_pred):
|
||||
|
||||
次に、入力をモデルに渡し、`logits `を返します。
|
||||
|
||||
```
|
||||
```py
|
||||
>>> logits = run_inference(trained_model, sample_test_video["video"])
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user