Hi @ai4bilal thanks for posting! This issue is similar to the one here: 404 to any API i tried - #6 by meganariley.
You can request inference provider support for gpt2 on the model page: openai-community/gpt2 · Hugging Face (Click on ‘Ask for provider support’) or use this model with Inference Endpoints instead.
To see which models are available to use with HF Inference, check out our filtered search here. You can also subscribe to PRO! Perks include: 20x more inference usage, 8x ZeroGPU quota, 10x private storage capacity Check out PRO Account - Hugging Face for details.