FINGU-AI commited on
Commit
bb9db0e
โ€ข
1 Parent(s): 371ced8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +67 -3
README.md CHANGED
@@ -1,3 +1,67 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ ---
4
+ # FINGU-AI/Qwen2.5-7B-M
5
+
6
+ ## Overview
7
+ `FINGU-AI/Qwen2.5-7B-M` is a powerful causal language model designed for a variety of natural language processing (NLP) tasks, including machine translation, text generation, and chat-based applications. This model is particularly useful for translating between Korean and Uzbek, as well as supporting other custom NLP tasks through flexible input.
8
+
9
+ ## Model Details
10
+ - **Model ID**: `FINGU-AI/Qwen2.5-7B-M`
11
+ - **Architecture**: Causal Language Model (LM)
12
+ - **Parameters**: 7 billion
13
+ - **Precision**: Torch BF16 for efficient GPU memory usage
14
+ - **Attention**: SDPA (Scaled Dot-Product Attention)
15
+ - **Primary Use Case**: Translation (e.g., Korean to Uzbek), text generation, and dialogue systems.
16
+
17
+ ## Example Usage
18
+
19
+ ### Installation
20
+ Make sure to install the required packages:
21
+
22
+ ```bash
23
+ pip install torch transformers
24
+ ```
25
+ ### Loading the Model
26
+
27
+ ```python
28
+ from transformers import AutoTokenizer, AutoModelForCausalLM
29
+ import torch
30
+
31
+ # Model and Tokenizer
32
+ model_id = 'FINGU-AI/Qwen2.5-7B-M'
33
+ model = AutoModelForCausalLM.from_pretrained(model_id, attn_implementation="sdpa", torch_dtype=torch.bfloat16)
34
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
35
+ model.to('cuda')
36
+
37
+ # Input Messages for Translation
38
+ messages = [
39
+ {"role": "system", "content": "translate korean to Uzbek"},
40
+ {"role": "user", "content": """์ƒˆ๋กœ์šด ์€ํ–‰ ๊ณ„์ขŒ๋ฅผ ๊ฐœ์„คํ•˜๋Š” ์ ˆ์ฐจ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™์Šต๋‹ˆ๋‹ค:
41
+
42
+ 1. ๊ณ„์ขŒ ๊ฐœ์„ค ๋ชฉ์ ๊ณผ ์‹ ๋ถ„ ํ™•์ธ์„ ์œ„ํ•œ ์„œ๋ฅ˜ ์ œ์ถœ
43
+ 2. ์„œ๋ฅ˜ ๊ฒ€ํ†  ๊ณผ์ •์„ ๊ฑฐ์น˜๋Š” ๊ฒƒ
44
+ 3. ๊ณ ๊ฐ๋‹˜์˜ ์‹ ์› ํ™•์ธ ์ ˆ์ฐจ๋ฅผ ์ง„ํ–‰ํ•˜๋Š” ๊ฒƒ
45
+ 4. ๋ชจ๋“  ์ ˆ์ฐจ๊ฐ€ ์™„๋ฃŒ๋˜๋ฉด ๊ณ„์ขŒ ๊ฐœ์„ค์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
46
+
47
+ ๊ณ„์ขŒ ๊ฐœ์„ค์„ ์›ํ•˜์‹œ๋Š” ๊ฒฝ์šฐ, ์‹ ๋ถ„์ฆ๊ณผ ํ•จ๊ป˜ ๋ฐฉ๋ฌธํ•ด ์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค.
48
+ """},
49
+ ]
50
+
51
+ # Tokenize and Generate Response
52
+ input_ids = tokenizer.apply_chat_template(
53
+ messages,
54
+ add_generation_prompt=True,
55
+ return_tensors="pt"
56
+ ).to('cuda')
57
+
58
+ outputs = model.generate(
59
+ input_ids,
60
+ max_new_tokens=500,
61
+ do_sample=True,
62
+ )
63
+
64
+ # Decode and Print the Translation
65
+ response = outputs[0][input_ids.shape[-1]:]
66
+ print(tokenizer.decode(response, skip_special_tokens=True))
67
+ ```