The issue is due to version incompatibility. You can resolve this by downgrading TensorFlow, TensorFlow Hub, and Keras to compatible versions. Try running the following commands to install the versions that are known to work together:
pip install tensorflow==2.15.0 tensorflow-hub keras==2.15.0
Once you've installed the correct versions, your code should work without the ValueError: Only instances of keras.Layer can be added to a Sequential model error.