input: Write a python function to generate text from a trained model.
  assert generate_text(model, tokenizer, 5, "This is going to be", 10) == "the generated text"
  assert generate_text(model, tokenizer, 3, "Once upon", 5) == "a time in a land"
  assert generate_text(model, tokenizer, 4, "In a galaxy", 7) == "far far away there was a"
output: def generate_text(model, tokenizer, seed, prompt, length):
      import random
      random.seed(seed)
      
      generated = prompt
      for _ in range(length):
          input_ids = tokenizer.encode(generated, return_tensors='pt')
          output = model(input_ids)[0]
          next_token_id = random.choice(output.argmax(dim=-1).tolist()[0])
          next_token = tokenizer.decode(next_token_id)
          
          generated += next_token
      
      return generated