Update metadata with huggingface_hub (#1)
- Update metadata with huggingface_hub (909e0cfb914b7d85ba95fc242ecc89e5a2cd7ae3) Co-authored-by: Vaibhav Srivastav <reach-vb@users.noreply.huggingface.co>
This commit is contained in:
12
README.md
12
README.md
@@ -1,10 +1,11 @@
|
|||||||
---
|
---
|
||||||
license: apache-2.0
|
base_model: Qwen/Qwen2.5-14B-Instruct
|
||||||
license_link: https://huggingface.co/Qwen/Qwen2.5-14B-Instruct-AWQ/blob/main/LICENSE
|
|
||||||
language:
|
language:
|
||||||
- en
|
- en
|
||||||
|
library_name: transformers
|
||||||
|
license: apache-2.0
|
||||||
|
license_link: https://huggingface.co/Qwen/Qwen2.5-14B-Instruct-AWQ/blob/main/LICENSE
|
||||||
pipeline_tag: text-generation
|
pipeline_tag: text-generation
|
||||||
base_model: Qwen/Qwen2.5-14B-Instruct
|
|
||||||
tags:
|
tags:
|
||||||
- chat
|
- chat
|
||||||
---
|
---
|
||||||
@@ -49,8 +50,8 @@ Also check out our [AWQ documentation](https://qwen.readthedocs.io/en/latest/qua
|
|||||||
Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
|
Here provides a code snippet with `apply_chat_template` to show you how to load the tokenizer and model and how to generate contents.
|
||||||
|
|
||||||
```python
|
```python
|
||||||
from modelscope import AutoModelForCausalLM, AutoTokenizer
|
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||||
model_name = "qwen/Qwen2.5-14B-Instruct-AWQ"
|
model_name = "Qwen/Qwen2.5-14B-Instruct-AWQ"
|
||||||
model = AutoModelForCausalLM.from_pretrained(
|
model = AutoModelForCausalLM.from_pretrained(
|
||||||
model_name,
|
model_name,
|
||||||
torch_dtype="auto",
|
torch_dtype="auto",
|
||||||
@@ -76,7 +77,6 @@ generated_ids = [
|
|||||||
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
||||||
]
|
]
|
||||||
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
||||||
print(response)
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Processing Long Texts
|
### Processing Long Texts
|
||||||
|
|||||||
Reference in New Issue
Block a user