mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-02 05:44:03 +02:00
Correct structure
This commit is contained in:
@@ -2,11 +2,19 @@
|
|||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Compensate for old cpu without avx2
|
# Check if the CPU supports AVX2
|
||||||
if [[ "$(uname -m)" = "x86_64" && lscpu | grep -q "Flags" && ! lscpu | grep -q "avx2" ]]; then
|
if [[ "$(uname -m)" = "x86_64" ]]; then
|
||||||
bashio::log.warning "NON SUPPORTED CPU DETECTED"
|
# Get the CPU flags
|
||||||
bashio::log.warning "Your cpu doesn't support avx2, the analyzer service will likely won't work"
|
cpu_flags=$(lscpu | grep "Flags" | awk '{print $2}')
|
||||||
bashio::log.warning "Trying to install tensorflow instead of tflite_runtime instead"
|
|
||||||
$PYTHON_VIRTUAL_ENV /usr/bin/pip3 uninstall -y tflite_runtime
|
# Check if avx2 is NOT present in the flags
|
||||||
$PYTHON_VIRTUAL_ENV /usr/bin/pip3 install tensorflow
|
if [[ ! "$cpu_flags" =~ "avx2" ]]; then
|
||||||
|
bashio::log.warning "NON SUPPORTED CPU DETECTED"
|
||||||
|
bashio::log.warning "Your CPU doesn't support AVX2, the analyzer service likely won't work."
|
||||||
|
bashio::log.warning "Trying to install tensorflow instead of tflite_runtime."
|
||||||
|
|
||||||
|
# Uninstall tflite_runtime and install tensorflow
|
||||||
|
$PYTHON_VIRTUAL_ENV /usr/bin/pip3 uninstall -y tflite_runtime
|
||||||
|
$PYTHON_VIRTUAL_ENV /usr/bin/pip3 install tensorflow
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user