Package: gptchem
gptchemUse GPT-3 to solve chemistry problems.
Most of the repo is currently not intended for use as library but as documentation of our experiments.
We'll factor out the experiments (that come with tricky dependencies) into its own repository over time.💪 Getting Startedfromgptchem.gpt_classifierimportGPTClassifierfromgptchem.tunerimportTunerclassifier=GPTClassifier(property_name="transition wavelength",# this is the property name we will use in the prompt templatetuner=Tuner(n_epochs=8,learning_rate_multiplier=0.02,wandb_sync=False),)classifier.fit(["CC","CDDFSS"],[0,1])predictions=classifier.predict(['CCCC','CCCCCCCC'])The time these call take can vary as the methods call the OpenAI API under the hood. Therefore, in situation of high load, we also experienced hours of waiting time in the queue.🚀 InstallationThe most recent code and data can be installed directly from GitHub with:$pipinstallgit+https://github.com/kjappelbaum/gptchem.gitThe installation should only take a few seconds to minutes. You can install additional depenencies using the extrasexperimentsandeval.👐 ContributingContributions, whether filing an issue, making a pull request, or forking, are appreciated. SeeCONTRIBUTING.mdfor more information on getting involved.👋 Attribution⚖️ LicenseThe code in this package is licensed under the MIT License.📖 CitationIf you found this package useful, please cite our preprint@inproceedings{Jablonka_2023,
	doi = {10.26434/chemrxiv-2023-fw8n4},
	url = {https://doi.org/10.26434%2Fchemrxiv-2023-fw8n4},
	year = 2023,
	month = {feb},
	booktitle = {ChemRxiv},
	author = {Kevin Maik Jablonka and Philippe Schwaller and Andres Ortega-Guerrero and Berend Smit},
	title = {Is {GPT} all you need for low-data discovery in chemistry?}
}🛠️ For DevelopersSee developer instructionsThe final section of the README is for if you want to get involved by making a code contribution.Development InstallationTo install in development mode, use the following:$gitclonegit+https://github.com/kjappelbaum/gptchem.git
$cdgptchem
$pipinstall-e.🥼 TestingAfter cloning the repository and installingtoxwithpip install tox, the unit tests in thetests/folder can be
run reproducibly with:$toxAdditionally, these tests are automatically re-run with each commit in aGitHub Action.📖 Building the DocumentationThe documentation can be built locally using the following:$gitclonegit+https://github.com/kjappelbaum/gptchem.git
$cdgptchem
$tox-edocs
$opendocs/build/html/index.htmlThe documentation automatically installs the package as well as thedocsextra specified in thesetup.cfg.sphinxplugins
liketexextcan be added there. Additionally, they need to be added to theextensionslist indocs/source/conf.py.📦 Making a ReleaseAfter installing the package in development mode and installingtoxwithpip install tox, the commands for making a new release are contained within thefinishenvironment
intox.ini. Run the following from the shell:$tox-efinishThis script does the following:UsesBump2Versionto switch the version number in thesetup.cfg,src/gptchem/version.py, anddocs/source/conf.pyto not have the-devsuffixPackages the code in both a tar archive and a wheel usingbuildUploads to PyPI usingtwine. Be sure to have a.pypircfile configured to avoid the need for manual input at this
stepPush to GitHub. You'll need to make a release going with the commit where the version was bumped.Bump the version to the next patch. If you made big changes and want to bump the version by minor, you can
usetox -e bumpversion minorafter.🍪 CookiecutterThis package was created with@audreyfeldroy'scookiecutterpackage using@cthoyt'scookiecutter-snekpacktemplate.