Upload folder using huggingface_hub
Browse files- README.md +6 -3
- model.safetensors +1 -1
README.md
CHANGED
|
@@ -29,10 +29,13 @@ config.intermediate_size = 6
|
|
| 29 |
config.num_attention_heads = 4
|
| 30 |
config.num_hidden_layers = 2
|
| 31 |
config.num_key_value_heads = 2
|
|
|
|
| 32 |
|
| 33 |
model = transformers.AutoModelForCausalLM.from_config(
|
| 34 |
-
config, trust_remote_code=True)
|
| 35 |
model = model.half()
|
|
|
|
|
|
|
| 36 |
|
| 37 |
tokenizer = transformers.AutoTokenizer.from_pretrained(
|
| 38 |
source_model_id, trust_remote_code=True)
|
|
@@ -45,6 +48,6 @@ print(result)
|
|
| 45 |
model.save_pretrained(save_path)
|
| 46 |
tokenizer.save_pretrained(save_path)
|
| 47 |
os.system(f'ls -alh {save_path}')
|
| 48 |
-
create_repo(repo_id, exist_ok=True)
|
| 49 |
-
upload_folder(repo_id=repo_id, folder_path=save_path)
|
| 50 |
```
|
|
|
|
| 29 |
config.num_attention_heads = 4
|
| 30 |
config.num_hidden_layers = 2
|
| 31 |
config.num_key_value_heads = 2
|
| 32 |
+
config.torch_dtype = torch.float16
|
| 33 |
|
| 34 |
model = transformers.AutoModelForCausalLM.from_config(
|
| 35 |
+
config, trust_remote_code=True, torch_dtype=torch.float16)
|
| 36 |
model = model.half()
|
| 37 |
+
print(next(iter(model.parameters())).dtype)
|
| 38 |
+
model.config.torch_dtype = torch.float16
|
| 39 |
|
| 40 |
tokenizer = transformers.AutoTokenizer.from_pretrained(
|
| 41 |
source_model_id, trust_remote_code=True)
|
|
|
|
| 48 |
model.save_pretrained(save_path)
|
| 49 |
tokenizer.save_pretrained(save_path)
|
| 50 |
os.system(f'ls -alh {save_path}')
|
| 51 |
+
# create_repo(repo_id, exist_ok=True)
|
| 52 |
+
# upload_folder(repo_id=repo_id, folder_path=save_path)
|
| 53 |
```
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3215696
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0b31730a65c0a5975358dce3ab7fa6e96aeff6acd6bdcdabf75dc60ada7644a8
|
| 3 |
size 3215696
|