Improve language tag
#1
by
lbourdois
- opened
README.md
CHANGED
|
@@ -1,58 +1,68 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
pipeline_tag: text-generation
|
| 4 |
-
language:
|
| 5 |
-
-
|
| 6 |
-
-
|
| 7 |
-
-
|
| 8 |
-
|
| 9 |
-
-
|
| 10 |
-
|
| 11 |
-
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
-
|
| 16 |
-
-
|
| 17 |
-
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
model
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
language:
|
| 5 |
+
- zho
|
| 6 |
+
- eng
|
| 7 |
+
- fra
|
| 8 |
+
- spa
|
| 9 |
+
- por
|
| 10 |
+
- deu
|
| 11 |
+
- ita
|
| 12 |
+
- rus
|
| 13 |
+
- jpn
|
| 14 |
+
- kor
|
| 15 |
+
- vie
|
| 16 |
+
- tha
|
| 17 |
+
- ara
|
| 18 |
+
base_model:
|
| 19 |
+
- Qwen/Qwen2.5-7B-Instruct
|
| 20 |
+
tags:
|
| 21 |
+
- qwen2.5
|
| 22 |
+
---
|
| 23 |
+
|
| 24 |
+
### theqwenmoe
|
| 25 |
+
- 18.3B parametrs
|
| 26 |
+
- English & Russian
|
| 27 |
+
- Math & Logic
|
| 28 |
+
- Code: Python, Javascript, Java, PHP, C++, C#, ...
|
| 29 |
+
|
| 30 |
+
This is experimental model. Can be bugs and various problems.
|
| 31 |
+
|
| 32 |
+
Made with mergekit and unsloth apps by ehristoforu.
|
| 33 |
+
|
| 34 |
+
Code usage example:
|
| 35 |
+
```py
|
| 36 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 37 |
+
|
| 38 |
+
model_name = "ehristoforu/theqwenmoe"
|
| 39 |
+
|
| 40 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 41 |
+
model_name,
|
| 42 |
+
torch_dtype="auto",
|
| 43 |
+
device_map="auto"
|
| 44 |
+
)
|
| 45 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 46 |
+
|
| 47 |
+
prompt = "Give me a short introduction to large language model."
|
| 48 |
+
messages = [
|
| 49 |
+
{"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
|
| 50 |
+
{"role": "user", "content": prompt}
|
| 51 |
+
]
|
| 52 |
+
text = tokenizer.apply_chat_template(
|
| 53 |
+
messages,
|
| 54 |
+
tokenize=False,
|
| 55 |
+
add_generation_prompt=True
|
| 56 |
+
)
|
| 57 |
+
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
|
| 58 |
+
|
| 59 |
+
generated_ids = model.generate(
|
| 60 |
+
**model_inputs,
|
| 61 |
+
max_new_tokens=512
|
| 62 |
+
)
|
| 63 |
+
generated_ids = [
|
| 64 |
+
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
|
| 65 |
+
]
|
| 66 |
+
|
| 67 |
+
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
|
| 68 |
```
|