Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
# For reference on model card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1
|
| 3 |
+
# Doc / guide: https://huggingface.co/docs/hub/model-cards
|
| 4 |
+
{}
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# CT-LLM-Base
|
| 8 |
+
[**🌐 Homepage**](https://chinese-tiny-llm.github.io) | [**🤗 MAP-CC**](https://huggingface.co/datasets/m-a-p/MAP-CC) | [**🤗 CHC-Bench**](https://huggingface.co/datasets/m-a-p/CHC-Bench) | [**🤗 CT-LLM**](https://huggingface.co/collections/m-a-p/chinese-tiny-llm-660d0133dff6856f94ce0fc6) | [**📖 arXiv**]() | [**GitHub**](https://github.com/Chinese-Tiny-LLM/Chinese-Tiny-LLM)
|
| 9 |
+
|
| 10 |
+
CT-LLM-Base is the first Chinese-centric large language model, both pre-training and fine-tuned primarily on Chinese corpora, and offers significant insights into potential biases, Chinese language ability, and multilingual adaptability.
|
| 11 |
+
|
| 12 |
+
## Uses
|
| 13 |
+
|
| 14 |
+
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
| 15 |
+
```
|
| 16 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 17 |
+
|
| 18 |
+
model_path = '<your-model-path>'
|
| 19 |
+
|
| 20 |
+
tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False, trust_remote_code=True)
|
| 21 |
+
|
| 22 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 23 |
+
model_path,
|
| 24 |
+
device_map="auto",
|
| 25 |
+
torch_dtype='auto'
|
| 26 |
+
).eval()
|
| 27 |
+
|
| 28 |
+
input_text = "很久很久以前,"
|
| 29 |
+
|
| 30 |
+
input_ids = tokenizer(input_text, add_generation_prompt=True, return_tensors='pt').to(model.device)
|
| 31 |
+
output_ids = model.generate(**input_ids, max_new_tokens=20)
|
| 32 |
+
response = tokenizer.decode(output_ids[0], skip_special_tokens=True)
|
| 33 |
+
|
| 34 |
+
print(response)
|
| 35 |
+
|
| 36 |
+
```
|