概要
OpenAI CODEXを使ってPythonコードをC++に変換します。
AI・機械学習計測したスター増加
- 24時間
- 0
- 7日間
- 0
- 15日間
- 0
- 1か月
- 履歴を収集中
期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。
README.md
オリジナル🦾 codex_py2cpp 🤖
OpenAI Codex Python to C++ Code Generator
Your Python Code is too slow? 🐌 You want to speed it up but forgot how to code in C++? ⌨ Convert your Python script to C++ Code using OpenAI Codex.
How it works
Reads a Python file and creates an input prompt which is then fed to OpenAI Codex to generate corresponding C++ code. The generated code is getting compiled using g++ and if compilation is successful the executable is saved.
To generate your own files you need to get access to the Codex API (https://openai.com/blog/openai-codex/).
Installation
git clone https://github.com/alxschwrz/codex_py2cpp.git
cd codex_py2cpp
pip3 install -r requirements.txt
Run example
Reads the file "simpleScript.py", and feeds the corresponding input prompt to OpenAI Codex. Compilable solutions are stored in the form of .cpp and .exe files.
python3 python2cppconverter.py
If the generated C++ code got compiled, test it with
./simpleScript.exe
You hopefully get the same output as when running
python3 simpleScript.py
Check how much faster you are now ...
time ./simpleScript.exe
time python3 simpleScript.py
Example Code Generation:
| [In]: Python Snippet | [Out]: How the CODEX conversion might look like |
|---|---|
|
|
Please test your generated code before usage. This does not produce robust code conversions, but is intended to experiment with codex. [WIP]
Credits
This project is based on the OpenAI Codex project. Inspired by https://github.com/tom-doerr
関連プロジェクトを探す
読み込み中…