Beat03 commited on
Commit
e847680
·
verified ·
1 Parent(s): e5152e9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -10,9 +10,9 @@ import os
10
  API_KEY = os.getenv("ZHIPUAI_API_KEY", "d659608f7d5d42b1821a9303fc50b618.NesCuIytwpxjxpBJ")
11
  client = ZhipuAI(api_key=API_KEY)
12
 
13
- # def extract_text(image):
14
- # if isinstance(image, np.ndarray): # Chuyển NumPy array thành ảnh
15
- # image = Image.fromarray(image)
16
 
17
 
18
  # Chuyển đổi ảnh sang Base64
 
10
  API_KEY = os.getenv("ZHIPUAI_API_KEY", "d659608f7d5d42b1821a9303fc50b618.NesCuIytwpxjxpBJ")
11
  client = ZhipuAI(api_key=API_KEY)
12
 
13
+ def extract_text(image):
14
+ if isinstance(image, np.ndarray): # Chuyển NumPy array thành ảnh
15
+ image = Image.fromarray(image)
16
 
17
 
18
  # Chuyển đổi ảnh sang Base64