(event, context)
| 124 | return result.stdout |
| 125 | |
| 126 | def handler(event, context): |
| 127 | # test_matvmul() |
| 128 | # test_two_layer_nn() |
| 129 | model_data = read_most_recent_data_file() |
| 130 | #print(model_data['data']) |
| 131 | # generate_params_json_trading_bot_three_layer_nn(a_weights, a_bias, |
| 132 | # b_weights, b_bias, |
| 133 | # c_weights, c_bias) |
| 134 | |
| 135 | #print(subprocess.run("pip3 install cairo-lang".split(" "), capture_output=True)) |
| 136 | #print(subprocess.run("pwd", capture_output=True)) |
| 137 | #print(subprocess.run("sudo chmod 777 ./starknet".split(" "), capture_output=True)) |
| 138 | |
| 139 | |
| 140 | output = test_trading_bot_three_layer_nn(model_data['a_data_ptr'], |
| 141 | model_data['a_bias_ptr'], |
| 142 | model_data['b_data_ptr'], |
| 143 | model_data['b_bias_ptr'], |
| 144 | model_data['c_data_ptr'], |
| 145 | model_data['c_bias_ptr'], |
| 146 | model_data['data'], |
| 147 | model_data['price_ratio'], |
| 148 | model_data['remaining_usdc'], |
| 149 | model_data['remaining_weth'], |
| 150 | invoke=True) |
| 151 | |
| 152 | transHash = re.search("(Transaction hash: )([0-9a-fA-Fx]+)", output.decode('utf-8')).group(2) |
| 153 | print(transHash) |
| 154 | |
| 155 | with open("./dev/transHashData/current_trans_hash.json", "w") as outfile: |
| 156 | outfile.write(json.dumps(transHash)) |
| 157 | # a_weights, a_bias, b_weights, b_bias, mnist_data = load_mist_torch_weights( |
| 158 | # ) |
| 159 | # test_two_layer_nn(a_weights, |
| 160 | # a_bias, |
| 161 | # b_weights, |
| 162 | # b_bias, |
| 163 | # mnist_data, |
| 164 | # invoke=False) |
| 165 | return 0 |
| 166 | |
| 167 | if __name__ == "__main__": |
| 168 | handler((), ()) |
no test coverage detected