MNIST_Demo_1 / config_counter.py
xiaohua828's picture
Update config_counter.py
5ae1029
raw
history blame
889 Bytes
import json
import transformers
from transformers import PretrainedConfig,AutoConfig,AutoModelForCausalLM
from huggingface_hub import interpreter_login
from huggingface_hub import notebook_login
from transformers import PretrainedConfig
from typing import List
from transformers.configuration_utils import PretrainedConfig
class GLMConfig(PretrainedConfig):
def __init__(
self,
weight=1.,
bias=3,
torch_dtype = "float32",
**kwargs
):
self.weight = weight
self.bias = bias
self.torch_dtype = torch_dtype
self.model_type = "counter"
super().__init__(**kwargs)
if __name__ == '__main__':
import login
glm_config = PretrainedConfig.from_json_file("./config.json")
# config = GLMConfig()
# config.update(glm_config)
glm_config.push_to_hub(login.name_or_path)