text
stringlengths
1
93.6k
"pin": "ุชุซุจูŠุช ๐Ÿ“Œ",
"unpin": "ุงู„ุบุงุก ุชุซุจูŠุช ๐Ÿ“Œ",
"ban": "ุงู„ุนุถูˆ [{}](tg://user?id={}) ุชู… ุญุธุฑู‡ โŒ",
"ban_id": "ุงู„ุนุถูˆ {} ุชู… ุญุธุฑู‡",
"banError": "ุงู„ุนุถูˆ ุบูŠุฑ ู…ุญุธูˆุฑ ๐Ÿ™„",
"muteError": "ุงู„ุนุถูˆ ู„ูŠุณ ู…ูƒุชูˆู… ๐Ÿ™„",
"admins": {
"0": "ู„ุง ูŠูˆุฌุฏ ู…ุดุฑููŠู† โŒ",
"1": "๐Ÿ‘ค ุงู„ู…ุฏูŠุฑ : {}\nุงู„ู…ุดุฑููŠู† :\n{}"
},
"filter": "โ˜ ๏ธ ุชู… ุงุถุงูุฉ ุงู„ูƒู„ู…ุฉ ู„ู‚ุงุฆู…ุฉ ุงู„ูƒู„ู…ุงุช ุงู„ู…ุญุธูˆุฑุฉ :\n{}",
"unfilter": "โ˜ ๏ธ ุชู… ุงุฒุงู„ุฉ ุงู„ูƒู„ู…ุฉ ู…ู† ู‚ุงุฆู…ุฉ ุงู„ูƒู„ู…ุงุช ุงู„ู…ุญุธูˆุฑุฉ :\n{}",
"filters": "๐Ÿค ุงู„ูƒู„ู…ุงุช ุงู„ู…ุญุธูˆุฑุฉ :\n{}",
"mute": "ุงู„ุนุถูˆ [{}](tg://user?id={}) ุชู… ุงุถุงูุชู‡ ู„ู‚ุงุฆู…ุฉ ุงู„ู…ูƒุชูˆู…ูŠู† ู„ู…ุฏุฉ {} ูŠูˆู…",
"unmute": "ุชู… ุงู„ุบุงุก ุงู„ูƒุชู… :)",
"muteAll": {
"0": "ุชู… ู‚ูู„ ุงู„ู…ุฌู…ูˆุนุฉ โœ…",
"1": "ุงู„ู…ุฌู…ูˆุนุฉ ู…ู‚ูู„ุฉ ู…ุณุจู‚ุง โœ…"
},
"unmuteAll": {
"0": "ุชู… ูุชุญ ุงู„ู…ุฌู…ูˆุนุฉ โœ…",
"1": "ุงู„ู…ุฌู…ูˆุนุฉ ุบูŠุฑ ู…ู‚ูู„ุฉ โœ…"
},
"admins_set": ""
},
"admin": {
"add": {
"0": "ุงู„ู…ุฌู…ูˆุนุฉ ู…ูุนู„ุฉ ู…ุณุจู‚ุง ๐Ÿ”–",
"1": "ุชู… ุชูุนูŠู„ ุงู„ุจูˆุช ููŠ ุงู„ู…ุฌู…ูˆุนุฉ โœ…"
},
"rem": {
"0": "ุชู… ุงุฒุงู„ุฉ ุงู„ุจูˆุช ู…ู† ุงู„ู…ุฌู…ูˆุนุฉ ๐Ÿ’ข",
"1": "ุงู„ู…ุฌู…ูˆุนุฉ ู„ูŠุณุช ู…ูุนู„ุฉ ๐Ÿ’ข"
}
},
"who": {
"name": "๐Ÿ‘ค *{} {}*",
"group": "๐Ÿ‘ฅ *{}*",
"id": "๐Ÿ†” \\[{}]",
"username": "โ–ถ๏ธ @{}"
}
}
}
# <FILESEP>
# Copyright 2023 NNAISENSE SA
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import torch
import functools
from abc import abstractmethod
from torch.distributions.normal import Normal
from torch.distributions.categorical import Categorical as torch_Categorical
from torch.distributions.bernoulli import Bernoulli as torch_Bernoulli
from torch.distributions.mixture_same_family import MixtureSameFamily
from torch.distributions.uniform import Uniform
from math import log
from utils_model import (
safe_exp,
safe_log,
idx_to_float,
float_to_idx,
quantize, sandwich,
)
class CtsDistribution:
@abstractmethod
def log_prob(self, x):
pass
@abstractmethod
def sample(self):
pass
class DiscreteDistribution:
@property
@abstractmethod
def probs(self):
pass
@functools.cached_property
def log_probs(self):
return safe_log(self.probs)