Ruu3f / freeGPT

freeGPT provides free access to text and image generation models.
GNU General Public License v3.0
457 stars 55 forks source link

403 error on gpt3 #14

Closed ghost closed 1 year ago

ghost commented 1 year ago

Hi ruu3f Please solve this Bug

BUG 403 error on gpt3

Code import freeGPT from asyncio import run

async def main(): while True: prompt = input("👦: ") try: resp = await getattr(freeGPT, "gpt3").Completion().create(prompt) print(f"🤖: {resp}") except Exception as e: print(f"🤖: {e}")

run(main())

Output PS C:\Users\HP> python -u "c:\Python_files\main.py" 👦: hi 🤖: 👦: who are you 🤖:

Statement You can see i asked hi and tell nothing So i saw the source code And i add extra one return value to find problem old code = return resp changed code = return resp,resp_obj

run that code after changing

output 👦: hi 🤖: ('', <ClientResponse(https://ava-alpha-api.codelink.io/api/chat) [403 Forbidden]> <CIMultiDictProxy('Date': 'Sun, 27 Aug 2023 17:23:00 GMT', 'Content-Type': 'text/html', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'x-powered-by': 'Express', 'Access-Control-Allow-Origin': '*', 'x-cloud-trace-context': 'dcdfc9a5c798b7ae7b669395f77c257a', 'Via': '1.1 google', 'CF-Cache-Status': 'DYNAMIC', 'Report-To': '{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=mZGmHaoXnCDP4McZ7JWbS6js9G63OsAUbjicRUWbBgeqG4%2FNdOqZ1DOjRSL3yiqlTwOA3g1F0uywRD6AfjpnMJe7yq866ZaJL3JZhU2QV45yQDzTNTNTIlqNXCeGL0XFZHEBnCZoIlwWTo3Tutg8t0yHCYRZgZA%3D"}],"group":"cf-nel","max_age":604800}', 'NEL': '{"success_fraction":0,"report_to":"cf-nel","max_age":604800}', 'Server': 'cloudflare', 'CF-RAY': '7fd5fff4eba947c0-BOM', 'Content-Encoding': 'gzip')> )

conclusion i found your code have 403 request error Please debug this problem

Ruu3f commented 1 year ago

Use the latest version: pip install freeGPT==1.3.2