lrl-modelcloud
commited on
Commit
•
37e8e60
1
Parent(s):
062bc45
Update README.md
Browse files
README.md
CHANGED
@@ -38,7 +38,9 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
|
|
38 |
|
39 |
model = GPTQModel.from_quantized(model_name)
|
40 |
|
41 |
-
|
42 |
-
outputs = model.generate(
|
43 |
-
|
|
|
|
|
44 |
```
|
|
|
38 |
|
39 |
model = GPTQModel.from_quantized(model_name)
|
40 |
|
41 |
+
input_tensor = tokenizer.apply_chat_template(prompt, add_generation_prompt=True, return_tensors="pt")
|
42 |
+
outputs = model.generate(input_ids=input_tensor.to(model.device), max_new_tokens=100)
|
43 |
+
result = tokenizer.decode(outputs[0][input_tensor.shape[1]:], skip_special_tokens=True)
|
44 |
+
|
45 |
+
print(result)
|
46 |
```
|