Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 2 |
+
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
|
| 3 |
+
quantized_model_dir = "cczhong/internlm-chat-7b-4bit-gptq"
|
| 4 |
+
tokenizer = AutoTokenizer.from_pretrained(quantized_model_dir, trust_remote_code=True)
|
| 5 |
+
model = AutoGPTQForCausalLM.from_quantized(quantized_model_dir, device="cuda:0",trust_remote_code=True)
|
| 6 |
+
response, history = model.chat(tokenizer, "你好", history=[])
|