# MacOSにUnslothをインストール

ローカルの Apple macOS デバイスに Unsloth をインストールするには、以下の手順に従ってください:

### Unsloth をインストール

```bash
curl -fsSL https://unsloth.ai/install.sh | sh
```

更新するには同じコマンドを使用するか、 `unsloth studio update`.

### Unsloth を更新

```bash
unsloth studio update
```

### 起動

Unsloth を再度起動したいときは毎回:

```bash
unsloth studio -H 0.0.0.0 -p 8888
```

詳細な Unsloth Studio のインストール手順と要件については、 [ガイドをご覧ください](/docs/jp/xin-zhe/studio/install.md).

### アンインストール

macOS で Unsloth Studio をアンインストールするには、次の 4 つの手順に従ってください:

#### **1. アプリケーションを削除する**

* macOS、Linux: `rm -rf ~/.unsloth/studio/unsloth_studio`

これによりアプリケーションは削除されますが、モデルのチェックポイント、エクスポート、履歴、キャッシュ、チャットはそのまま残ります。

#### **2. ショートカットとシンボリックリンクを削除する**

**macOS:**

```bash
rm -rf ~/Applications/Unsloth\ Studio.app ~/Desktop/Unsloth\ Studio
```

#### **3. CLI コマンドを削除する**

**macOS、Linux:**

```bash
rm -f ~/.local/bin/unsloth
```

#### **4. すべてを削除する（オプション）**

履歴、キャッシュ、チャット、モデルのチェックポイント、モデルのエクスポートも削除するには、Unsloth フォルダ全体を削除してください:

* macOS、Linux: `rm -rf ~/.unsloth`

ダウンロードされた HF モデルファイルは Hugging Face のキャッシュに別々に保存されることに注意してください。上記の手順ではどれもそれらは削除されません。 **モデルファイルの削除** そのディスク容量を回収したい場合は、以下を参照してください。

古いモデルファイルは、モデル検索のゴミ箱アイコンから削除するか、Hugging Face キャッシュディレクトリから該当するキャッシュ済みモデルフォルダを削除して消去できます。

デフォルトのキャッシュ場所は次のとおりです:

{% code expandable="true" %}

```bash
~/.cache/huggingface/hub/
```

{% endcode %}

もし `HF_HUB_CACHE` または `HF_HOME` が設定されている場合は、その場所を代わりに使用してください。Linux と WSL では、 `XDG_CACHE_HOME` デフォルトのキャッシュルートも変更できます。次のコマンドで確認できます:

{% code expandable="true" %}

```bash
echo ${HF_HUB_CACHE:-${HF_HOME:-${XDG_CACHE_HOME:-$HOME/.cache}/huggingface}/hub}
```

{% endcode %}

特定のモデルを削除するには、そのフォルダ（例: `models--unsloth--Llama-3.1-8B-bnb-4bit`）をキャッシュディレクトリから削除します。すべてのキャッシュ済みモデルを消去するには:

{% code expandable="true" %}

```bash
rm -rf ~/.cache/huggingface/hub/
```

{% endcode %}

**1. アプリケーションを削除する**

macOS、WSL、Linux: `rm -rf ~/.unsloth/studio/unsloth ~/.unsloth/studio/studio`

これによりアプリケーションは削除されますが、モデルのチェックポイント、エクスポート、履歴、キャッシュ、チャットはそのまま残ります。

**2. ショートカットとシンボリックリンクを削除する**

**macOS:**

```bash
rm -rf ~/Applications/Unsloth\ Studio.app ~/Desktop/Unsloth\ Studio
```

**Linux:**

```bash
rm -f ~/.local/share/applications/unsloth-studio.desktop ~/Desktop/unsloth-studio.desktop
```

**WSL:**

```bash
rm -f ~/Desktop/unsloth-studio.desktop
```

WSL では Windows のショートカットも作成されます。PowerShell を開いて次を実行してください:

```powershell
Remove-Item -Force "$HOME\Desktop\Unsloth Studio.lnk"
Remove-Item -Force "$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Unsloth Studio.lnk"
```

**3. CLI コマンドを削除する**

```bash
rm -f ~/.local/bin/unsloth
```

**4. すべてを削除する（オプション）**

履歴、キャッシュ、チャット、モデルのチェックポイント、モデルのエクスポートも削除するには:

```
rm -rf ~/.unsloth
```

ダウンロードされたモデルファイルは Hugging Face のキャッシュに別々に保存されることに注意してください。上記の手順ではどれもそれらは削除されません。 **モデルファイルの削除** そのディスク容量を回収する方法については、

### **モデルファイルの削除**

古いモデルファイルは、モデル検索のゴミ箱アイコンから削除するか、Hugging Face キャッシュディレクトリから該当するキャッシュ済みモデルフォルダを削除して消去できます。

デフォルトのキャッシュ場所は次のとおりです:

```bash
~/.cache/huggingface/hub/
```

もし `HF_HUB_CACHE` または `HF_HOME` が設定されている場合は、その場所を代わりに使用してください。Linux と WSL では、 `XDG_CACHE_HOME` デフォルトのキャッシュルートも変更できます。次のコマンドで確認できます:

```bash
echo ${HF_HUB_CACHE:-${HF_HOME:-${XDG_CACHE_HOME:-$HOME/.cache}/huggingface}/hub}
```

特定のモデルを削除するには、そのフォルダ（例: `models--unsloth--Llama-3.1-8B-bnb-4bit`）をキャッシュディレクトリから削除します。すべてのキャッシュ済みモデルを消去するには:

```bash
rm -rf ~/.cache/huggingface/hub/
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://unsloth.ai/docs/jp/meru/install/mac.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
