From fa17dcce36dfc360d62bdb61e4e9be4f3a337ed1 Mon Sep 17 00:00:00 2001 From: Song Liu Date: Thu, 15 Aug 2024 14:20:59 +0800 Subject: [PATCH] Also modify the run.sh and README.md to make the HF_TOKEN para optional. Signed-off-by: Song Liu --- convert_models/README.md | 4 ++-- convert_models/run.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/convert_models/README.md b/convert_models/README.md index 8251080b..8610f5ca 100644 --- a/convert_models/README.md +++ b/convert_models/README.md @@ -19,10 +19,10 @@ podman build -t converter . ## Quantize and Convert -You can run the conversion image directly with podman in the terminal. You just need to provide it with the huggingface model name you want to download, the quantization level you want to use and whether or not you want to keep the raw files after conversion. +You can run the conversion image directly with podman in the terminal. You just need to provide it with the huggingface model name you want to download, the quantization level you want to use and whether or not you want to keep the raw files after conversion. "HF_TOKEN" is optional, it is required for private models. ```bash -podman run -it --rm -v models:/converter/converted_models -e HF_MODEL_URL= -e HF_TOKEN= -e QUANTIZATION=Q4_K_M -e KEEP_ORIGINAL_MODEL="False" localhost/converter +podman run -it --rm -v models:/converter/converted_models -e HF_MODEL_URL= -e HF_TOKEN= -e QUANTIZATION=Q4_K_M -e KEEP_ORIGINAL_MODEL="False" converter ``` You can also use the UI shown above to do the same. diff --git a/convert_models/run.sh b/convert_models/run.sh index 2118904b..a14214f8 100644 --- a/convert_models/run.sh +++ b/convert_models/run.sh @@ -1,7 +1,7 @@ #! /bin/bash hf_model_url=${HF_MODEL_URL} -hf_token=${HF_TOKEN} +hf_token=${HF_TOKEN:="None"} model_org=$(echo $hf_model_url | sed -n 's/\(.*\)\/\(.*\)/\1/p') model_name=$(echo $hf_model_url | sed -n 's/\(.*\)\/\(.*\)/\2/p') keep_orgi=${KEEP_ORIGINAL_MODEL}