show code js

顯示具有 docker 標籤的文章。 顯示所有文章
顯示具有 docker 標籤的文章。 顯示所有文章

2025年2月8日 星期六

modify openwebui open file will happen error when user not admin

  • backup files.py

sudo docker exec -it open-webui /bin/bash cd /app/backend/open_webui/routers/ cp files.py files1.py
  • modify files.py
sudo docker cp open-webui:/app/backend/open_webui/routers/files.py files.py sudo nano files.py find all  if file and (file.user_id == user.id or user.role == "admin"): and add front remark like this #if file and (file.user_id == user.id or user.role == "admin"): and add code under this line if file:
  • replace files.py
sudo docker cp files.py open-webui:/app/backend/open_webui/routers/files.py

2025年1月29日 星期三

docker clean

 #remove old container and images

  • run all container
  • remove old container and images,volume
  • docker system prune
  • docker volume prune
  • docker builder prune
  • stop all container{docker stop $(docker ps -q)}
  • stop docker desktop{Stop-Process -Name "Docker Desktop"}
  • wsl --shutdown
  • Optimize-VHD -Path C:\Users\yourname\AppData\Local\Docker\wsl\data\ext4.vhdx -Mode Full
  • Optimize-VHD -Path C:\Users\yourname\AppData\Local\Docker\wsl\main\ext4.vhdx -Mode Full
  • wsl
  • start docker desktop{Start-Process "Docker Desktop"}
  • start all container{docker start $(docker ps -aq)}

searxng

  • docker pull searxng/searxng
  • docker run -d -p 4000:8080 -e "BASE_URL=http://localhost:4000/" -e "INSTANCE_NAME=searxng" searxng/searxng

Install docker on ubuntu

  • sudo apt update
  • sudo apt install apt-transport-https ca-certificates curl software-properties-common
  • curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  • sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  • sudo apt update
  • sudo apt install docker-ce
  • sudo docker run hello-world
  • sudo apt install docker-compose

2024年12月29日 星期日

create ocs on docker

  •  git clone https://github.com/OCSInventory-NG/OCSInventory-Docker-Image
  • cd OCSInventory-Docker-Image
  • cd new_version
  • modify docker-compose.yml config ports
  • PS>docker-compose up -d

2024年9月16日 星期一

use axolotl for trainning

Env

  • no internet
  • qlora_root c:\qlora
  • gguf_root c:\gguf

Dataset 

  • c:/qlora/output_dataset/instruction_dataset.parquet

PS:Axolotl

  • docker run --gpus '"all"' --rm -it winglian/axolotl:main-latest
PS:Dataset
  • docker cp C:\qlora\output_dataset\instruction_dataset.parquet container_name:/workspace/axolotl/examples/instruction_dataset.parquet

PS:LLM

  • docker cp C:\Meta-Llama-3.1-8B container_name:/workspace/axolotl/examples/Meta-Llama-3.1-8B/

Axolotl:Qlora

  • open ./examples/llama-3/qlora.yml find and modify path of llm and parquet

Axolotl:Trainning

  • CUDA_VISIBLE_DEVICES="" python -m axolotl.cli.preprocess examples/llama-3/qlora.yml
  • accelerate launch -m axolotl.cli.train examples/llama-3/qlora.yml

Axolotl:Test(need internet)

  • accelerate launch -m axolotl.cli.inference examples/llama-3/qlora.yml --lora_model_dir="./outputs/qlora-out" --gradio

Axolotl:Merged

  • python3 -m axolotl.cli.merge_lora examples/llama-3/qlora.yml --lora_model_dir="./outputs/qlora-out"

PS:Export

  • docker cp container_name:/workspace/axolotl/outputs/qlora-out/merged C:\merged

GGUF

  • convert to merged_f16.gguf

Ollama

  • ollama run merged