Spaces:
Sleeping
Sleeping
| import yaml | |
| def load_yaml(path): | |
| with open(path, "r", encoding="utf-8") as f: | |
| return yaml.safe_load(f) | |
| def softmax(xs): | |
| import numpy as np | |
| x = np.array(xs, dtype=float) | |
| e = np.exp(x - x.max()) | |
| return (e / e.sum()).tolist() | |