wlabchoi commited on
Commit
f9c8c49
·
verified ·
1 Parent(s): 231d921

Upload train_qwen3_telecom.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. train_qwen3_telecom.py +11 -9
train_qwen3_telecom.py CHANGED
@@ -13,22 +13,24 @@ raw_dataset = load_dataset('netop/TeleQnA', split='test')
13
 
14
  def format_for_sft(example):
15
  """Convert TeleQnA format to chat messages format"""
16
- # Build the question with options
17
- options_text = []
18
- for i in range(1, 6): # Handle up to 5 options
19
- option_key = f'option {i}'
20
- if option_key in example and example[option_key]:
21
- options_text.append(f'{i}. {example[option_key]}')
 
22
 
23
  question_with_options = f"""{example['question']}
24
 
25
  Options:
26
- {chr(10).join(options_text)}"""
27
 
28
- # Build the answer with explanation
 
29
  answer_text = f"""{example['answer']}
30
 
31
- Explanation: {example['explanation']}"""
32
 
33
  # Format as chat messages
34
  return {
 
13
 
14
  def format_for_sft(example):
15
  """Convert TeleQnA format to chat messages format"""
16
+ # Dataset columns: question, choices, answer, subject, explaination
17
+
18
+ # Build the question with choices
19
+ choices_text = []
20
+ if 'choices' in example and example['choices']:
21
+ for i, choice in enumerate(example['choices'], 1):
22
+ choices_text.append(f'{i}. {choice}')
23
 
24
  question_with_options = f"""{example['question']}
25
 
26
  Options:
27
+ {chr(10).join(choices_text)}"""
28
 
29
+ # Build the answer with explanation (note: misspelled as 'explaination' in dataset)
30
+ explanation = example.get('explaination', '') or example.get('explanation', '')
31
  answer_text = f"""{example['answer']}
32
 
33
+ Explanation: {explanation}"""
34
 
35
  # Format as chat messages
36
  return {