building-agents/test.py

42 lines
1.1 KiB
Python
Raw Permalink Normal View History

2024-06-25 11:02:53 +08:00
# import json
# import numpy as np
#
#
# def get_llm_action(index) -> np.ndarray:
# with open('data/llm_action.json', 'r') as file:
# data = json.load(file)
# normalized_index = index % len(data)
# action = np.array(data[normalized_index])
# return action
#
# data = get_llm_action(2)
# print(data)
2024-08-27 10:20:32 +08:00
import numpy as np
import json
from data_manager import DataManager
2024-06-18 10:49:43 +08:00
2024-08-27 10:20:32 +08:00
data_manager = DataManager()
llm_actions = json.load(open('data/results.json', 'r'))
2024-07-30 09:05:32 +08:00
2024-08-27 10:20:32 +08:00
for action in llm_actions:
data_manager.add_llm_element(action)
month = np.random.randint(1, 13) # choose 12 month
day = np.random.randint(1, 20)
llm_action = data_manager.get_llm_data(month, day, 1)
print(len(data_manager.LLM))
2024-07-30 09:05:32 +08:00
2024-08-27 10:20:32 +08:00
# import torch
#
#
# def get_available_gpus():
# if torch.cuda.is_available():
# num_gpus = torch.cuda.device_count()
# print(f"Number of available GPUs: {num_gpus}")
# for i in range(num_gpus):
# print(f"GPU {i}: {torch.cuda.get_device_name(i)}")
# else:
# print("No GPUs are available.")
#
#
# get_available_gpus()