diabolic6045 commited on
Commit
4e4d4a7
·
verified ·
1 Parent(s): 3d3991e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -5,7 +5,7 @@ import torch
5
  import transformers
6
  from transformers import GPT2LMHeadModel, GPT2Tokenizer, Trainer, TrainingArguments, DataCollatorForLanguageModeling
7
  from datasets import Dataset
8
- import spaces
9
 
10
  # Set random seeds for reproducibility
11
  random.seed(42)
@@ -59,7 +59,7 @@ def prepare_dataset(data, tokenizer, block_size=128):
59
  tokenized_dataset.set_format(type='torch', columns=['input_ids', 'attention_mask', 'labels'])
60
  return tokenized_dataset
61
 
62
- @spaces.GPU()
63
  def fitness_function(individual, train_dataset, tokenizer, model_state_dict):
64
  # Initialize the model inside this function
65
  model = GPT2LMHeadModel.from_pretrained('gpt2')
 
5
  import transformers
6
  from transformers import GPT2LMHeadModel, GPT2Tokenizer, Trainer, TrainingArguments, DataCollatorForLanguageModeling
7
  from datasets import Dataset
8
+ # import spaces
9
 
10
  # Set random seeds for reproducibility
11
  random.seed(42)
 
59
  tokenized_dataset.set_format(type='torch', columns=['input_ids', 'attention_mask', 'labels'])
60
  return tokenized_dataset
61
 
62
+ # @spaces.GPU()
63
  def fitness_function(individual, train_dataset, tokenizer, model_state_dict):
64
  # Initialize the model inside this function
65
  model = GPT2LMHeadModel.from_pretrained('gpt2')