mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
Add missing file
This commit is contained in:
parent
f4f04c8c32
commit
21058c37f7
18
modules/RoPE.py
Normal file
18
modules/RoPE.py
Normal file
@ -0,0 +1,18 @@
|
||||
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.)
|
Loading…
Reference in New Issue
Block a user