ariG23498 HF Staff commited on
Commit
ac71606
·
verified ·
1 Parent(s): 0bb8b16

Upload allenai_olmOCR-2-7B-1025_0.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. allenai_olmOCR-2-7B-1025_0.py +18 -9
allenai_olmOCR-2-7B-1025_0.py CHANGED
@@ -18,17 +18,26 @@ try:
18
  with open('allenai_olmOCR-2-7B-1025_0.txt', 'w', encoding='utf-8') as f:
19
  f.write('Everything was good in allenai_olmOCR-2-7B-1025_0.txt')
20
  except Exception as e:
21
- with open('allenai_olmOCR-2-7B-1025_0.txt', 'w', encoding='utf-8') as f:
 
 
 
 
 
 
 
 
22
  import traceback
23
- traceback.print_exc(file=f)
 
 
24
 
25
- import os
26
- from slack_sdk import WebClient
27
- client = WebClient(token=os.environ['SLACK_TOKEN'])
28
- client.chat_postMessage(
29
- channel='#exp-slack-alerts',
30
- text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/allenai_olmOCR-2-7B-1025_0.txt|allenai_olmOCR-2-7B-1025_0.txt>',
31
- )
32
  finally:
33
  from huggingface_hub import upload_file
34
  upload_file(
 
18
  with open('allenai_olmOCR-2-7B-1025_0.txt', 'w', encoding='utf-8') as f:
19
  f.write('Everything was good in allenai_olmOCR-2-7B-1025_0.txt')
20
  except Exception as e:
21
+ import os
22
+ from slack_sdk import WebClient
23
+ client = WebClient(token=os.environ['SLACK_TOKEN'])
24
+ client.chat_postMessage(
25
+ channel='#exp-slack-alerts',
26
+ text='Problem in <https://huggingface.co/datasets/model-metadata/code_execution_files/blob/main/allenai_olmOCR-2-7B-1025_0.txt|allenai_olmOCR-2-7B-1025_0.txt>',
27
+ )
28
+
29
+ with open('allenai_olmOCR-2-7B-1025_0.txt', 'a', encoding='utf-8') as f:
30
  import traceback
31
+ f.write('```CODE:
32
+ # Use a pipeline as a high-level helper
33
+ from transformers import pipeline
34
 
35
+ pipe = pipeline("image-to-text", model="allenai/olmOCR-2-7B-1025")
36
+ ```
37
+ ERROR:
38
+ ')
39
+ traceback.print_exc(file=f)
40
+
 
41
  finally:
42
  from huggingface_hub import upload_file
43
  upload_file(