Skip to content

Commit

Permalink
Also modify the run.sh and README.md to make the HF_TOKEN para optional.
Browse files Browse the repository at this point in the history
Signed-off-by: Song Liu <[email protected]>
  • Loading branch information
Song Liu committed Aug 15, 2024
1 parent 3f1bb61 commit fa17dcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions convert_models/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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=<ORG/MODEL_NAME> -e HF_TOKEN=<YOUR_HF_TOKEN_ID> -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=<ORG/MODEL_NAME> -e HF_TOKEN=<YOUR_HF_TOKEN_ID> -e QUANTIZATION=Q4_K_M -e KEEP_ORIGINAL_MODEL="False" converter
```

You can also use the UI shown above to do the same.
Expand Down
2 changes: 1 addition & 1 deletion convert_models/run.sh
Original file line number Diff line number Diff line change
@@ -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}
Expand Down

0 comments on commit fa17dcc

Please sign in to comment.