ariG23498 HF Staff commited on
Commit
93ff4e8
·
verified ·
1 Parent(s): 63be717

Upload Wan-AI_Wan2.2-T2V-A14B-Diffusers_2.py with huggingface_hub

Browse files
Wan-AI_Wan2.2-T2V-A14B-Diffusers_2.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "transformers",
5
+ # "torch",
6
+ # ]
7
+ # ///
8
+
9
+ try:
10
+ import os
11
+ from huggingface_hub import InferenceClient
12
+
13
+ client = InferenceClient(
14
+ provider="auto",
15
+ api_key=os.environ["HF_TOKEN"],
16
+ )
17
+
18
+ video = client.text_to_video(
19
+ "A young man walking on the street",
20
+ model="Wan-AI/Wan2.2-T2V-A14B-Diffusers",
21
+ )
22
+ with open('Wan-AI_Wan2.2-T2V-A14B-Diffusers_2.txt', 'w') as f:
23
+ f.write('Everything was good in Wan-AI_Wan2.2-T2V-A14B-Diffusers_2.txt')
24
+ except Exception as e:
25
+ with open('Wan-AI_Wan2.2-T2V-A14B-Diffusers_2.txt', 'w') as f:
26
+ import traceback
27
+ traceback.print_exc(file=f)
28
+ finally:
29
+ from huggingface_hub import upload_file
30
+ upload_file(
31
+ path_or_fileobj='Wan-AI_Wan2.2-T2V-A14B-Diffusers_2.txt',
32
+ repo_id='model-metadata/custom_code_execution_files',
33
+ path_in_repo='Wan-AI_Wan2.2-T2V-A14B-Diffusers_2.txt',
34
+ repo_type='dataset',
35
+ )