bstraehle commited on
Commit
2750069
1 Parent(s): 6f10d1e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -39,11 +39,10 @@ def fine_tune_model(base_model_id, dataset):
39
  model_name = "meta-llama/Meta-Llama-3.1-8B-Instruct"
40
  model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
41
  tokenizer = AutoTokenizer.from_pretrained(model_name)
42
- tokenizer.padding_side = "right"
43
 
44
  # Preprocess the dataset
45
  def preprocess(examples):
46
- model_inputs = tokenizer(examples["sql_prompt"], text_target=examples["sql"], max_length=512, truncation=True)
47
  return model_inputs
48
 
49
  dataset = dataset.map(preprocess, batched=True)
 
39
  model_name = "meta-llama/Meta-Llama-3.1-8B-Instruct"
40
  model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")
41
  tokenizer = AutoTokenizer.from_pretrained(model_name)
 
42
 
43
  # Preprocess the dataset
44
  def preprocess(examples):
45
+ model_inputs = tokenizer(examples["sql_prompt"], text_target=examples["sql"], max_length=512, padding="max_length", truncation=True)
46
  return model_inputs
47
 
48
  dataset = dataset.map(preprocess, batched=True)