Commit 38e073f0 authored by wanglch's avatar wanglch
Browse files

Update README.md

parent 1b1f5e2c
......@@ -111,20 +111,19 @@ sh lora_finetune_multi.sh
## 推理
若要执行推理需要将本仓库修改后的[visual.py](visual.py)替换模型文件中的**visual.py**文件,并替换模型路径
若要执行推理需要将本仓库修改后的[visual.py](visual.py)替换模型文件中的**visual.py**文件。
`tokenizer = AutoTokenizer.from_pretrained("/home/wanglch/projects/GLM-4V/glm-4v-b", trust_remote_code=True)`
### 单机单卡
`tokenizer = AutoTokenizer.from_pretrained("/home/wanglch/projects/GLM-4V/glm-4v-9b", trust_remote_code=True)`
`model = AutoModelForCausalLM.from_pretrained(
"/home/wanglch/projects/GLM-4V/glm-4v-b",
"/home/wanglch/projects/GLM-4V/glm-4v-9b",
torch_dtype=torch.float16,
low_cpu_mem_usage=True,
trust_remote_code=True
).to(device).eval()`
### 单机单卡
```
python glm-4v_inference.py
```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment