Related to #7207
Modify the code to allow the docker container to start in an offline environment for versions >= 0.4.0.
* **backend/open_webui/retrieval/utils.py**
- Import `OFFLINE_MODE` from `open_webui.env`.
- Set `local_files_only` to `True` when `OFFLINE_MODE` is enabled in `snapshot_kwargs`.
* **backend/open_webui/env.py**
- Add logic to set `HF_HUB_OFFLINE` environment variable to `1` when `OFFLINE_MODE` is enabled.
* **README.md**
- Document setting `HF_HUB_OFFLINE` environment variable to `1` for offline environments.
Previously, the `DATA_DIR` environment variable was always overridden by defaulting to `OPEN_WEBUI_DIR / "data"`, which ignored user-defined `DATA_DIR` values. Additionally, when `DATA_DIR` and `NEW_DATA_DIR` were the same, the script attempted to copy files into themselves, leading to errors or redundant operations.
This commit ensures that:
1. The `DATA_DIR` environment variable is respected and not overridden.
2. Copy operations between `DATA_DIR` and `NEW_DATA_DIR` are only performed if the directories are different, preventing errors when they point to the same location.
These changes resolve potential file copy errors and preserve user configurations.