Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyouga committed Apr 25, 2023
1 parent d803b9d commit 8d70dd1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,11 @@ CUDA_VISIBLE_DEVICES=0 python src/web_demo.py \
```

### Deploy the Fine-tuned Model

```python
from .src import load_pretrained, ModelArguments
import sys
sys.path.append("src")
from src import load_pretrained, ModelArguments
model_args = ModelArguments(checkpoint_dir=path_to_checkpoint)
model, tokenizer = load_pretrained(model_args)
model = model.half().cuda()
Expand Down
4 changes: 3 additions & 1 deletion README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ CUDA_VISIBLE_DEVICES=0 python src/web_demo.py \
### 模型部署

```python
from .src import load_pretrained, ModelArguments
import sys
sys.path.append("src")
from src import load_pretrained, ModelArguments
model_args = ModelArguments(checkpoint_dir=path_to_checkpoint)
model, tokenizer = load_pretrained(model_args)
model = model.half().cuda()
Expand Down
2 changes: 1 addition & 1 deletion src/utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def prepare_args() -> Tuple[ModelArguments, DataTrainingArguments, Seq2SeqTraini
if model_args.quantization_bit is not None: # perform FP16 checking or GPU checking
if finetuning_args.finetuning_type == "p_tuning":
if training_args.fp16:
raise ValueError("Fp16 training conflicts with quantized p-tuning.")
raise ValueError("FP16 training conflicts with quantized p-tuning.")
else:
from bitsandbytes.cuda_setup.main import get_compute_capability, get_cuda_lib_handle, is_cublasLt_compatible
cuda = get_cuda_lib_handle()
Expand Down

0 comments on commit 8d70dd1

Please sign in to comment.