Update README.md
Browse files
README.md
CHANGED
@@ -36,15 +36,7 @@ input_ids = tokenizer(input_text, return_tensors='pt').input_ids.to(model.device
|
|
36 |
with torch.no_grad():
|
37 |
|
38 |
with torch.autocast('cuda'):
|
39 |
-
output = model.generate(input_ids=input_ids,
|
40 |
-
max_new_tokens=max_new_tokens,
|
41 |
-
do_sample=True,
|
42 |
-
temperature=0.85,
|
43 |
-
top_k=None,
|
44 |
-
top_p=0.9,
|
45 |
-
use_cache=True,
|
46 |
-
eos_token_id=[tokenizer.convert_tokens_to_ids('<|im_end|>') , tokenizer.convert_tokens_to_ids('<|endoftext|>')]
|
47 |
-
**kwargs)
|
48 |
|
49 |
reply = tokenizer.decode(output[0], skip_special_tokens=False)
|
50 |
reply_return=reply.split('<|im_start|>assistant\n')[-1]
|
|
|
36 |
with torch.no_grad():
|
37 |
|
38 |
with torch.autocast('cuda'):
|
39 |
+
output = model.generate(input_ids=input_ids, **kwargs)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40 |
|
41 |
reply = tokenizer.decode(output[0], skip_special_tokens=False)
|
42 |
reply_return=reply.split('<|im_start|>assistant\n')[-1]
|