lrl-modelcloud commited on
Commit
37e8e60
1 Parent(s): 062bc45

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +5 -3
README.md CHANGED
@@ -38,7 +38,9 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
38
 
39
  model = GPTQModel.from_quantized(model_name)
40
 
41
- inputs = tokenizer.apply_chat_template(prompt, tokenize=False, add_generation_prompt=True)
42
- outputs = model.generate(prompts=inputs, temperature=0.95, max_length=128)
43
- print(outputs[0].outputs[0].text)
 
 
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
  ```