Mageia commited on
Commit
763e463
1 Parent(s): 546c454

fix: cuda device

Browse files
Files changed (2) hide show
  1. got_ocr.py +3 -0
  2. requirements.txt +1 -0
got_ocr.py CHANGED
@@ -1,7 +1,10 @@
1
  import base64
2
  import os
3
 
 
4
 
 
 
5
  def got_ocr(model, tokenizer, image_path, got_mode="format texts OCR", fine_grained_mode="", ocr_color="", ocr_box=""):
6
  # 执行OCR
7
  try:
 
1
  import base64
2
  import os
3
 
4
+ import spaces
5
 
6
+
7
+ @spaces.GPU()
8
  def got_ocr(model, tokenizer, image_path, got_mode="format texts OCR", fine_grained_mode="", ocr_color="", ocr_box=""):
9
  # 执行OCR
10
  try:
requirements.txt CHANGED
@@ -9,3 +9,4 @@ transformers
9
  torch
10
  torchvision
11
  accelerate
 
 
9
  torch
10
  torchvision
11
  accelerate
12
+ spaces