ariG23498 HF Staff commited on
Commit
877271a
·
verified ·
1 Parent(s): fac7702

Upload Open-Bee_Bee-8B-RL_1.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. Open-Bee_Bee-8B-RL_1.py +29 -0
Open-Bee_Bee-8B-RL_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 AutoModel
15
+ model = AutoModel.from_pretrained("Open-Bee/Bee-8B-RL", trust_remote_code=True, torch_dtype="auto")
16
+ with open('Open-Bee_Bee-8B-RL_1.txt', 'w', encoding='utf-8') as f:
17
+ f.write('Everything was good in Open-Bee_Bee-8B-RL_1.txt')
18
+ except Exception as e:
19
+ with open('Open-Bee_Bee-8B-RL_1.txt', 'w', encoding='utf-8') 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='Open-Bee_Bee-8B-RL_1.txt',
26
+ repo_id='model-metadata/code_execution_files',
27
+ path_in_repo='Open-Bee_Bee-8B-RL_1.txt',
28
+ repo_type='dataset',
29
+ )