|
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") |
|
|
|
|
|
glm_config.push_to_hub(login.name_or_path) |
|
|
|
|
|
|