💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows
Python agentsaiai-agentsembeddingsinformation-retrievallanguage-modellarge-language-modelsllmnlppythonragretrieval-augmented-generationsearchsearch-enginesemantic-searchsentence-embeddingstransformerstxtaivector-databasevector-search
Update code and build script to consolidate disabling MPS device around PYTORCH_MPS_DISABLE env variable
davidmezzettie32f61f8b915
diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex 756660f0..cf9def6c 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -42,7 +42,6 @@ jobs:echo "OMP_NUM_THREADS=1" >> $GITHUB_ENVecho "PYTORCH_MPS_DISABLE=1" >> $GITHUB_ENVecho "LLAMA_NO_METAL=1" >> $GITHUB_ENV- echo "ACCELERATE_USE_CPU=1" >> $GITHUB_ENVecho "TIKA_STARTUP_SLEEP=30" >> $GITHUB_ENVecho "TIKA_STARTUP_MAX_RETRY=10" >> $GITHUB_ENVif: matrix.os == 'macos-latest'diff --git a/docs/faq.md b/docs/faq.mdindex 32a85b7f..85ef73af 100644--- a/docs/faq.md+++ b/docs/faq.md@@ -107,10 +107,6 @@ Set the following environment parameters.- Disable PyTorch MPS device via `export PYTORCH_MPS_DISABLE=1`- Disable llama.cpp metal via `export LLAMA_NO_METAL=1`-If the issue is with a training pipeline.--- Disable GPU training via `export ACCELERATE_USE_CPU=1`-----------__Issue__diff --git a/src/python/txtai/pipeline/train/hftrainer.py b/src/python/txtai/pipeline/train/hftrainer.pyindex d568150f..ef04431d 100644--- a/src/python/txtai/pipeline/train/hftrainer.py+++ b/src/python/txtai/pipeline/train/hftrainer.py@@ -155,7 +155,7 @@ class HFTrainer(Tensors):"""# Default training arguments- args = {"output_dir": "", "save_strategy": "no", "report_to": "none", "log_level": "warning"}+ args = {"output_dir": "", "save_strategy": "no", "report_to": "none", "log_level": "warning", "use_cpu": not Models.hasaccelerator()}# Apply custom argumentsargs.update(updates)