Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python scripts to generate Fortran code by ChatGPT, compile it, correct errors, and run it -- broken by API changes. Tryhttps://github.com/Beliavsky/OpenAI-Fortran-agent instead

NotificationsYou must be signed in to change notification settings

Beliavsky/ChatGPT-Fortran-generator

Repository files navigation

Python script to generate Fortran codes by ChatGPT to perform tasks, compile them with gfortran, fix errors and warnings, and run them. ChatGPT is asked to code each task multiple times, because sometimes it produces code that fails to compile or gives wrong answers. Seeoutput_xfortran_chat.txt for sample output frompython xfortran_chat.py andoutput_xdebug_fortran.txt andoutput_xdebug_fortran_chatgpt_4.txt for sample output ofpython xdebug_fortran.py.

Thedebug_fortran function infortran.py shows how you can get a Fortran code to compile by iteratively sending compiler error messagesto ChatGPT and asking for fixes.

Update 2023-07-07

gpt-4 is now an allowed model in the API, and in the script one can set the variablegpt_model to it.

Update 2025-03-31

The scripts here no longer run, with error messages such as

You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API.

I suggest tryinghttps://github.com/Beliavsky/OpenAI-Fortran-agent instead.

About

Python scripts to generate Fortran code by ChatGPT, compile it, correct errors, and run it -- broken by API changes. Tryhttps://github.com/Beliavsky/OpenAI-Fortran-agent instead

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp