ariG23498 HF Staff commited on
Commit
6fe6c4c
·
verified ·
1 Parent(s): 1bcb5de

Upload KORMo-Team_KORMo-10B-sft_1.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. KORMo-Team_KORMo-10B-sft_1.py +29 -0
KORMo-Team_KORMo-10B-sft_1.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "torch",
5
+ # "torchvision",
6
+ # "transformers",
7
+ # "accelerate",
8
+ # "peft",
9
+ # ]
10
+ # ///
11
+
12
+ try:
13
+ # Load model directly
14
+ from transformers import AutoModelForCausalLM
15
+ model = AutoModelForCausalLM.from_pretrained("KORMo-Team/KORMo-10B-sft", trust_remote_code=True, torch_dtype="auto")
16
+ with open('KORMo-Team_KORMo-10B-sft_1.txt', 'w') as f:
17
+ f.write('Everything was good in KORMo-Team_KORMo-10B-sft_1.txt')
18
+ except Exception as e:
19
+ with open('KORMo-Team_KORMo-10B-sft_1.txt', 'w') as f:
20
+ import traceback
21
+ traceback.print_exc(file=f)
22
+ finally:
23
+ from huggingface_hub import upload_file
24
+ upload_file(
25
+ path_or_fileobj='KORMo-Team_KORMo-10B-sft_1.txt',
26
+ repo_id='model-metadata/custom_code_execution_files',
27
+ path_in_repo='KORMo-Team_KORMo-10B-sft_1.txt',
28
+ repo_type='dataset',
29
+ )