ariG23498 HF Staff commited on
Commit
9508f8c
·
verified ·
1 Parent(s): a91a79b

Upload yanolja_YanoljaNEXT-Rosetta-27B-2511_0.py with huggingface_hub

Browse files
yanolja_YanoljaNEXT-Rosetta-27B-2511_0.py ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "numpy",
5
+ # "einops",
6
+ # "pandas",
7
+ # "protobuf",
8
+ # "torch",
9
+ # "torchvision",
10
+ # "transformers",
11
+ # "timm",
12
+ # "diffusers",
13
+ # "sentence-transformers",
14
+ # "accelerate",
15
+ # "peft",
16
+ # "slack-sdk",
17
+ # ]
18
+ # ///
19
+
20
+ try:
21
+ # Use a pipeline as a high-level helper
22
+ from transformers import pipeline
23
+
24
+ pipe = pipeline("translation", model="yanolja/YanoljaNEXT-Rosetta-27B-2511")
25
+ with open('yanolja_YanoljaNEXT-Rosetta-27B-2511_0.txt', 'w', encoding='utf-8') as f:
26
+ f.write('Everything was good in yanolja_YanoljaNEXT-Rosetta-27B-2511_0.txt')
27
+ except Exception as e:
28
+ import os
29
+ from slack_sdk import WebClient
30
+ client = WebClient(token=os.environ['SLACK_TOKEN'])
31
+ client.chat_postMessage(
32
+ channel='#hub-model-metadata-snippets-sprint',
33
+ text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/yanolja_YanoljaNEXT-Rosetta-27B-2511_0.txt|yanolja_YanoljaNEXT-Rosetta-27B-2511_0.txt>',
34
+ )
35
+
36
+ with open('yanolja_YanoljaNEXT-Rosetta-27B-2511_0.txt', 'a', encoding='utf-8') as f:
37
+ import traceback
38
+ f.write('''```CODE:
39
+ # Use a pipeline as a high-level helper
40
+ from transformers import pipeline
41
+
42
+ pipe = pipeline("translation", model="yanolja/YanoljaNEXT-Rosetta-27B-2511")
43
+ ```
44
+
45
+ ERROR:
46
+ ''')
47
+ traceback.print_exc(file=f)
48
+
49
+ finally:
50
+ from huggingface_hub import upload_file
51
+ upload_file(
52
+ path_or_fileobj='yanolja_YanoljaNEXT-Rosetta-27B-2511_0.txt',
53
+ repo_id='model-metadata/code_execution_files',
54
+ path_in_repo='yanolja_YanoljaNEXT-Rosetta-27B-2511_0.txt',
55
+ repo_type='dataset',
56
+ )