ariG23498 HF Staff commited on
Commit
5260b6c
·
verified ·
1 Parent(s): 7533d86

Upload stepfun-ai_Step-Audio-EditX_0.py with huggingface_hub

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