ariG23498 HF Staff commited on
Commit
1ed92e5
·
verified ·
1 Parent(s): 35bf2fa

Upload Qwen_Qwen-Image-Edit-2509_0.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. Qwen_Qwen-Image-Edit-2509_0.py +43 -0
Qwen_Qwen-Image-Edit-2509_0.py ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # /// script
2
+ # requires-python = ">=3.12"
3
+ # dependencies = [
4
+ # "torch",
5
+ # "torchvision",
6
+ # "transformers",
7
+ # "accelerate",
8
+ # "peft",
9
+ # "slack-sdk",
10
+ # ]
11
+ # ///
12
+
13
+ try:
14
+ pip install -U diffusers transformers
15
+ with open('Qwen_Qwen-Image-Edit-2509_0.txt', 'w', encoding='utf-8') as f:
16
+ f.write('Everything was good in Qwen_Qwen-Image-Edit-2509_0.txt')
17
+ except Exception as e:
18
+ import os
19
+ from slack_sdk import WebClient
20
+ client = WebClient(token=os.environ['SLACK_TOKEN'])
21
+ client.chat_postMessage(
22
+ channel='#exp-slack-alerts',
23
+ text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/Qwen_Qwen-Image-Edit-2509_0.txt|Qwen_Qwen-Image-Edit-2509_0.txt>',
24
+ )
25
+
26
+ with open('Qwen_Qwen-Image-Edit-2509_0.txt', 'a', encoding='utf-8') as f:
27
+ import traceback
28
+ f.write('''```CODE:
29
+ pip install -U diffusers transformers
30
+ ```
31
+
32
+ ERROR:
33
+ ''')
34
+ traceback.print_exc(file=f)
35
+
36
+ finally:
37
+ from huggingface_hub import upload_file
38
+ upload_file(
39
+ path_or_fileobj='Qwen_Qwen-Image-Edit-2509_0.txt',
40
+ repo_id='model-metadata/code_execution_files',
41
+ path_in_repo='Qwen_Qwen-Image-Edit-2509_0.txt',
42
+ repo_type='dataset',
43
+ )