Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model Refactoring eos9taz: Done #5

Merged
merged 3 commits into from
Aug 1, 2023
Merged

Model Refactoring eos9taz: Done #5

merged 3 commits into from
Aug 1, 2023

Conversation

ZakiaYahya
Copy link
Collaborator

@ZakiaYahya ZakiaYahya commented Jul 25, 2023

I have made the following changes in the model
(1). Deleted all .dvc folders and files
(2) Update LICENSE file to GNU
(3) Modify src/service.py from predict torunapi and change python {0}/main.py {0}/MODEL_DIR {1} {2} to bash {0}/run.sh {0} {1} {2}
(4) Move MODEL_DIR that contains model file to checkpoints folder
(5) Move molecule_generation folder and main.py to code folder
(6) Add run.sh in framework folder
(7) Initially the number of molecules it is showing in the output is 99 due to this

        with open(output_file, 'w') as f:
        df['smiles'].iloc[0:99].to_csv(output_file, sep='\t', index=False)

So, i changed it to df['smiles'].iloc[0:100].to_csv(output_file, sep='\t', index=False) in main.py so it returns 100 samples of
generated molecules in the output file

(8) I have modified main.py as it is taking arguments directly as an input using argument parser and not using run.sh before, it is using def get_argparser() -> argparse.ArgumentParser: and def run_from_args(args: argparse.Namespace) -> None: functions to take arguments as an input and then parse it.
To omit arguments and the parser in the code and provide model_dir as an absolute path and input_file & output_file as an argument directly in the script, i modified the main() function and remove the argument parser.
In this modified version, the argument parser has been removed i.e. def get_argparser() and def run_from_args(args: argparse.Namespace) from main.py and simply replaced by

    ROOT = os.path.dirname(os.path.abspath(__file__))
    model_directory = os.path.abspath(os.path.join(ROOT,"..","..","checkpoints","MODEL_DIR"))
	
    input_file = sys.argv[1]
    output_file = sys.argv[2]

Thanks

@GemmaTuron GemmaTuron merged commit fe8fc07 into ersilia-os:main Aug 1, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants