def METHOD_NAME(model_name: str):
    max_length = 32
    model = huggingface_models.BIGBenchHFModel(
        model_name=model_name, max_length=max_length
    )
    response = model.generate_text(
        inputs="It was the best of times, it was",
    )
    assert response is not None
    assert len(response) <= max_length
    max_length //= 2
    response = model.generate_text(
        inputs="It was the best of times, it was", max_length=max_length
    )
    assert response is not None
    assert len(response) <= max_length
    max_length = -1
    with pytest.raises(ValueError):
        response = model.generate_text(
            inputs="It was the best of times, it was", max_length=max_length
        )