Download text-generation-webui_backup/modules/RoPE.py from ming512/llm: direct link, hf CLI and curl.
- Browser
- Download file 405 Bytes
-
https://huggingface.co/spaces/ming512/llm/resolve/main/text-generation-webui_backup/modules/RoPE.py
- Command line
-
hf download hf://spaces/ming512/llm/text-generation-webui_backup/modules/RoPE.py
-
curl -L -o RoPE.py https://huggingface.co/spaces/ming512/llm/resolve/main/text-generation-webui_backup/modules/RoPE.py
405 Bytes
| def get_alpha_value(alpha, base): | |
| ''' | |
| Gets alpha_value from alpha_value and rope_freq_base | |
| ''' | |
| if base > 0: | |
| return (base / 10000.) ** (63 / 64.) | |
| else: | |
| return alpha | |
| def get_rope_freq_base(alpha, base): | |
| ''' | |
| Gets rope_freq_base from alpha_value and rope_freq_base | |
| ''' | |
| if base > 0: | |
| return base | |
| else: | |
| return 10000 * alpha ** (64 / 63.) | |