Views
No views yet
waahsvt → waah + svt1請將以下粵語漢字轉寫為 Liujgoj 羅馬字:
2喺江南靠近海邊一條大路之上,有一隊清兵,手執刀槍,押住七架囚車,向住北方行緊。1Hair Gungjnaamx koihzingr hoijbinh yatj tiux daaihlukh zijsoengh,
2yauq yatj deoiraaj cingjbingj, saur zapj doujcoengj,
3aat zvh catj gaar kauxcej, hoeng zvh bouhfongx haangxganr.1請將以下 Liujgoj 羅馬字轉寫為粵語漢字:
2Waahsvt hair Cingjciux ge Hongjheij cojninx, dungjtinj ge mauq yatj yath.
3batjfungj yvx douj, munq deih bingjsoengj.話説喺清初嘅黃海戰爭,當天嘅某日。請將「waahsvt」拆分成音節,並標註音標。waah + svttransformers 載入模型:1import torch
2from transformers import AutoModel, AutoTokenizer
3
4model_id = "Yvthyvq/Liujgoj-Cantonese-Qwen2.5-Omni-7B-SFT"
5
6print("⏳ 載入模型中...")
7
8tokenizer = AutoTokenizer.from_pretrained(
9 model_id,
10 trust_remote_code=True
11)
12
13model = AutoModel.from_pretrained(
14 model_id,
15 torch_dtype=torch.bfloat16,
16 device_map="auto",
17 trust_remote_code=True
18)
19
20messages = [
21 {
22 "role": "user",
23 "content": "請將以下粵語漢字轉寫為 Liujgoj 羅馬字:\n喺江南靠近海邊一條大路之上,有一隊清兵,手執刀槍,押住七架囚車,向住北方行緊。"
24 }
25]
26
27text = tokenizer.apply_chat_template(
28 messages,
29 tokenize=False,
30 add_generation_prompt=True
31)
32
33inputs = tokenizer(
34 [text],
35 return_tensors="pt"
36).to("cuda")
37
38with torch.no_grad():
39 outputs = model.generate(
40 **inputs,
41 max_new_tokens=256,
42 temperature=0.1
43 )
44
45input_len = inputs.input_ids.shape[1]
46
47response = tokenizer.decode(
48 outputs[0][input_len:],
49 skip_special_tokens=True
50)
51
52print("Generated Response:")
53print(response.strip())1Qwen2.5-Omni-7B
2 │
3 ▼
4Liujgoj Cantonese CPT
5 │
6 ▼
7Liujgoj Cantonese SFT
8 │
9 ▼
10 ASR