ariG23498 HF Staff commited on
Commit
7a77ee1
·
verified ·
1 Parent(s): 45bc84c

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

Browse files
Files changed (1) hide show
  1. allenai_olmOCR-2-7B-1025-FP8_0.py +8 -2
allenai_olmOCR-2-7B-1025-FP8_0.py CHANGED
@@ -11,7 +11,10 @@
11
  # ///
12
 
13
  try:
14
- !pip install -U transformers
 
 
 
15
  with open('allenai_olmOCR-2-7B-1025-FP8_0.txt', 'w', encoding='utf-8') as f:
16
  f.write('Everything was good in allenai_olmOCR-2-7B-1025-FP8_0.txt')
17
  except Exception as e:
@@ -26,7 +29,10 @@ except Exception as e:
26
  with open('allenai_olmOCR-2-7B-1025-FP8_0.txt', 'a', encoding='utf-8') as f:
27
  import traceback
28
  f.write('''```CODE:
29
- !pip install -U transformers
 
 
 
30
  ```
31
 
32
  ERROR:
 
11
  # ///
12
 
13
  try:
14
+ # Use a pipeline as a high-level helper
15
+ from transformers import pipeline
16
+
17
+ pipe = pipeline("image-to-text", model="allenai/olmOCR-2-7B-1025-FP8")
18
  with open('allenai_olmOCR-2-7B-1025-FP8_0.txt', 'w', encoding='utf-8') as f:
19
  f.write('Everything was good in allenai_olmOCR-2-7B-1025-FP8_0.txt')
20
  except Exception as e:
 
29
  with open('allenai_olmOCR-2-7B-1025-FP8_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-FP8")
36
  ```
37
 
38
  ERROR: