Add training support and change lspci for Ascend NPU
Description
gpu_info=$(lspci 2>/dev/null | grep -E "VGA|Display")shows the iBMC chip VGA support for Ascend NPU because Ascend NPU has no ability of VGA or Display. So "npu-smi info" is more suitable to comfirm Ascend NPU exists.- support training of embedding and hypernetwork.
Screenshots/videos:
-
train embedding
-
train hypernetwork
Checklist:
- [x] I have read contributing wiki page
- [x] I have performed a self-review of my own code
- [x] My code follows the style guidelines
- [x] My code passes tests
And how would it look for the case where no videocard and no NPU is available?
If there are no video card and NPU, the torch_command will not change.
https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/cf2772fab0af5573da775e7437e6acdca424f26e/modules/launch_utils.py#L318
It will use cpu as backend and here is screen shoot running with a downloaded embedding,
There is a bug in windows with cpu, if using create Embedding, it could save success,
But there is no
test.pt when training, maybe something wrong in save embedding process.
What I mean is, it will try to run npu-smi, and that does not exist on most machine.
elif eval "npu-smi info" line should be elif npu-smi info 2>/dev/null
Sorry for my misunderstanding. It will print error on screen using elif eval "npu-smi info.
Your advise is so great.