alextorelli commited on
Commit
13d5dd9
·
verified ·
1 Parent(s): 6888b61

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -106,6 +106,7 @@ async def run_training_job(
106
  output_dir.mkdir(exist_ok=True)
107
 
108
  # Build autotrain-advanced CLI command
 
109
  cmd = [
110
  "autotrain",
111
  "llm",
@@ -116,33 +117,29 @@ async def run_training_job(
116
  dataset_path,
117
  "--text-column",
118
  text_column,
119
- "--prompt-text-column",
120
  response_column,
121
  "--project-name",
122
  f"codechef-{project_name}",
123
  "--push-to-hub",
124
- "--repo-id",
125
- repo_id,
126
  "--token",
127
  HF_TOKEN,
128
- # Auto-configuration
129
- "--auto-find-batch-size",
130
- "--use-peft",
131
  "--quantization",
132
  "int4",
133
  ]
134
 
135
  # Demo mode: reduce training
136
  if is_demo:
137
- cmd.extend(["--num-train-epochs", "1", "--max-seq-length", "512"])
138
  else:
139
- cmd.extend(["--num-train-epochs", "3", "--max-seq-length", "2048"])
140
 
141
  # Apply custom parameters
142
  if learning_rate:
143
- cmd.extend(["--learning-rate", str(learning_rate)])
144
  if num_epochs:
145
- cmd.extend(["--num-train-epochs", str(num_epochs)])
146
  if batch_size:
147
  cmd.extend(["--batch-size", str(batch_size)])
148
 
 
106
  output_dir.mkdir(exist_ok=True)
107
 
108
  # Build autotrain-advanced CLI command
109
+ # Using minimal args that are supported across versions
110
  cmd = [
111
  "autotrain",
112
  "llm",
 
117
  dataset_path,
118
  "--text-column",
119
  text_column,
120
+ "--target-column", # Changed from --prompt-text-column
121
  response_column,
122
  "--project-name",
123
  f"codechef-{project_name}",
124
  "--push-to-hub",
 
 
125
  "--token",
126
  HF_TOKEN,
127
+ "--peft", # Changed from --use-peft
 
 
128
  "--quantization",
129
  "int4",
130
  ]
131
 
132
  # Demo mode: reduce training
133
  if is_demo:
134
+ cmd.extend(["--epochs", "1"]) # Changed from --num-train-epochs
135
  else:
136
+ cmd.extend(["--epochs", "3"])
137
 
138
  # Apply custom parameters
139
  if learning_rate:
140
+ cmd.extend(["--lr", str(learning_rate)]) # Changed from --learning-rate
141
  if num_epochs:
142
+ cmd.extend(["--epochs", str(num_epochs)])
143
  if batch_size:
144
  cmd.extend(["--batch-size", str(batch_size)])
145