УЛЬТРА КРУТОЙ ВАЙБКОД ФИКСЫ И АВТОМОДЕЛЬ ТЕСЛА
This commit is contained in:
1 parent
5be8fcce19
commit
b0541faa3d
8 files changed
+328
-106
No files matched your search
@@ -0,0 +1,36 @@
|
||||
from vars import models_trust
|
||||
|
||||
|
||||
def trust_key(m: list):
|
||||
if len(m) >= 3:
|
||||
return m[0] + '*' + m[1] + '*' + m[2]
|
||||
return m[0] + '*' + m[1]
|
||||
|
||||
|
||||
def update_trust(m: list, text: dict):
|
||||
provider_key = m[0]
|
||||
model_key = trust_key(m)
|
||||
if provider_key not in models_trust:
|
||||
set_trust(provider_key, 80.0)
|
||||
if model_key not in models_trust:
|
||||
set_trust(model_key, 60.0)
|
||||
if text['type'] == 'error':
|
||||
if models_trust[model_key] > 10:
|
||||
models_trust[model_key] += -0.5
|
||||
models_trust[provider_key] += -0.08
|
||||
elif text['type'] == 'net':
|
||||
if models_trust[model_key] > 10:
|
||||
models_trust[model_key] += -0.2
|
||||
models_trust[provider_key] += -0.05
|
||||
elif text['type'] == 'da':
|
||||
if models_trust[model_key] < 100:
|
||||
models_trust[model_key] += 2
|
||||
models_trust[provider_key] += 0.2
|
||||
|
||||
|
||||
def get_trust(m: list):
|
||||
return models_trust.get(m[0], 80.0), models_trust.get(trust_key(m), 60.0)
|
||||
|
||||
|
||||
def set_trust(m: str, trust: float):
|
||||
models_trust[m] = trust
|
||||
Reference in new issue
Block a user