ariG23498 HF Staff commited on
Commit
f4713ba
·
verified ·
1 Parent(s): 51c5554

Upload vandijklab_C2S-Scale-Gemma-2-27B_1.py with huggingface_hub

Browse files
vandijklab_C2S-Scale-Gemma-2-27B_1.py ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 AutoTokenizer, AutoModelForCausalLM
15
+
16
+ tokenizer = AutoTokenizer.from_pretrained("vandijklab/C2S-Scale-Gemma-2-27B")
17
+ model = AutoModelForCausalLM.from_pretrained("vandijklab/C2S-Scale-Gemma-2-27B")
18
+ with open('vandijklab_C2S-Scale-Gemma-2-27B_1.txt', 'w', encoding='utf-8') as f:
19
+ f.write('Everything was good in vandijklab_C2S-Scale-Gemma-2-27B_1.txt')
20
+ except Exception as e:
21
+ with open('vandijklab_C2S-Scale-Gemma-2-27B_1.txt', 'w', encoding='utf-8') as f:
22
+ import traceback
23
+ traceback.print_exc(file=f)
24
+ finally:
25
+ from huggingface_hub import upload_file
26
+ upload_file(
27
+ path_or_fileobj='vandijklab_C2S-Scale-Gemma-2-27B_1.txt',
28
+ repo_id='model-metadata/code_execution_files',
29
+ path_in_repo='vandijklab_C2S-Scale-Gemma-2-27B_1.txt',
30
+ repo_type='dataset',
31
+ )