ariG23498 HF Staff commited on
Commit
0a1cd9f
·
verified ·
1 Parent(s): e5c7b10

Upload jzhang533_PaddleOCR-VL-For-Manga_0.py with huggingface_hub

Browse files
jzhang533_PaddleOCR-VL-For-Manga_0.py ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # Please refer to the document for information on how to use the model.
22
+ # https://paddlepaddle.github.io/PaddleOCR/latest/en/version3.x/module_usage/module_overview.html
23
+ with open('jzhang533_PaddleOCR-VL-For-Manga_0.txt', 'w', encoding='utf-8') as f:
24
+ f.write('Everything was good in jzhang533_PaddleOCR-VL-For-Manga_0.txt')
25
+ except Exception as e:
26
+ import os
27
+ from slack_sdk import WebClient
28
+ client = WebClient(token=os.environ['SLACK_TOKEN'])
29
+ client.chat_postMessage(
30
+ channel='#hub-model-metadata-snippets-sprint',
31
+ text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/jzhang533_PaddleOCR-VL-For-Manga_0.txt|jzhang533_PaddleOCR-VL-For-Manga_0.txt>',
32
+ )
33
+
34
+ with open('jzhang533_PaddleOCR-VL-For-Manga_0.txt', 'a', encoding='utf-8') as f:
35
+ import traceback
36
+ f.write('''```CODE:
37
+ # Please refer to the document for information on how to use the model.
38
+ # https://paddlepaddle.github.io/PaddleOCR/latest/en/version3.x/module_usage/module_overview.html
39
+ ```
40
+
41
+ ERROR:
42
+ ''')
43
+ traceback.print_exc(file=f)
44
+
45
+ finally:
46
+ from huggingface_hub import upload_file
47
+ upload_file(
48
+ path_or_fileobj='jzhang533_PaddleOCR-VL-For-Manga_0.txt',
49
+ repo_id='model-metadata/code_execution_files',
50
+ path_in_repo='jzhang533_PaddleOCR-VL-For-Manga_0.txt',
51
+ repo_type='dataset',
52
+ )