gpt4free icon indicating copy to clipboard operation
gpt4free copied to clipboard

g4f.errors.ResponseStatusError: Response 403: {"detail":{"error":"Not authenticated"}}

Open mahditorabi76 opened this issue 1 year ago • 4 comments
trafficstars

my code

client = Client(provider='DeepInfra')

response_q = client.chat.completions.create(model="meta-llama/Meta-Llama-3-70B-Instruct", extra_body={"provider": "DeepInfra"}, messages=[{"role": "user", "content": prompt}])

error Traceback (most recent call last): File "", line 1, in File "c:\Users\lenovo\Desktop\Projects\GTP4FREE\venv\lib\site-packages\g4f\client\client.py", line 114, in create return response if stream else next(response) File "c:\Users\lenovo\Desktop\Projects\GTP4FREE\venv\lib\site-packages\g4f\client\client.py", line 53, in iter_append_model_and_provider for chunk in response: File "c:\Users\lenovo\Desktop\Projects\GTP4FREE\venv\lib\site-packages\g4f\client\client.py", line 28, in iter_response for idx, chunk in enumerate(response): File "c:\Users\lenovo\Desktop\Projects\GTP4FREE\venv\lib\site-packages\g4f\providers\base_provider.py", line 216, in create_completion yield loop.run_until_complete(await_callback(gen.anext)) File "C:\Users\lenovo\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete return future.result() File "c:\Users\lenovo\Desktop\Projects\GTP4FREE\venv\lib\site-packages\g4f\providers\base_provider.py", line 45, in await_callback return await callback() File "c:\Users\lenovo\Desktop\Projects\GTP4FREE\venv\lib\site-packages\g4f\Provider\needs_auth\Openai.py", line 56, in create_async_generator await raise_for_status(response) File "c:\Users\lenovo\Desktop\Projects\GTP4FREE\venv\lib\site-packages\g4f\requests\raise_for_status.py", line 28, in raise_for_status_async raise ResponseStatusError(f"Response {response.status}: {message}") g4f.errors.ResponseStatusError: Response 403: {"detail":{"error":"Not authenticated"}}

mahditorabi76 avatar Apr 28 '24 09:04 mahditorabi76

Hey there! It seems like the free GPT model might not be accessible in your region. Have you tried using the Llama model? Let me know if that works for you!

hlohaus avatar Apr 29 '24 07:04 hlohaus

Hey there! It seems like the free GPT model might not be accessible in your region. Have you tried using the Llama model? Let me know if that works for you!

Yes, i use Llama but same error

mahditorabi76 avatar Apr 29 '24 10:04 mahditorabi76

Hey, DeepInfra shut down their free service. You should try using the Llama provider instead.

hlohaus avatar May 01 '24 16:05 hlohaus

Bumping this issue because it has been open for 7 days with no activity. Closing automatically in 7 days unless it becomes active again.

github-actions[bot] avatar May 09 '24 00:05 github-actions[bot]

Closing due to inactivity.

github-actions[bot] avatar May 16 '24 00:05 github-actions[bot]