def METHOD_NAME(self):
    tokenizer = AutoTokenizer.from_pretrained("__internal_testing__/tiny-random-llama")
    model = AutoModelForCausalLM.from_pretrained("__internal_testing__/tiny-random-llama")
    model.config.eos_token_id = -1
    input_kwargs = self.get_inputs(model)
    streamer = TextIteratorStreamer(tokenizer, timeout=0.001)
    generation_kwargs = {**input_kwargs, "streamer": streamer}
    thread = Thread(target=model.generate, kwargs=generation_kwargs)
    thread.start()
    # The streamer will timeout after 0.001 seconds, so an exception will be raised
    with self.assertRaises(Empty):
        streamer_text = ""
        for new_text in streamer:
            streamer_text += new_text