demohug commited on
Commit
246a3a7
·
1 Parent(s): e803330
Files changed (2) hide show
  1. api.py +1 -1
  2. app.py +3 -3
api.py CHANGED
@@ -161,7 +161,7 @@ async def extract_glb(
161
  try:
162
  # 加载状态
163
  state_path = os.path.join(user_dir, 'state.npz')
164
- state = np.load(state_path)
165
  state = {k: state[k] for k in state.files}
166
 
167
  # 生成 GLB
 
161
  try:
162
  # 加载状态
163
  state_path = os.path.join(user_dir, 'state.npz')
164
+ state = np.load(state_path, allow_pickle=True, encoding='latin1')
165
  state = {k: state[k] for k in state.files}
166
 
167
  # 生成 GLB
app.py CHANGED
@@ -253,9 +253,9 @@ async def api_extract_glb(request: Request):
253
  if not os.path.exists(user_dir):
254
  raise HTTPException(status_code=404, detail="Session not found")
255
 
256
- # 加载状态
257
  state_path = os.path.join(user_dir, 'state.npz')
258
- state_file = np.load(state_path, allow_pickle=True)
259
 
260
  # 首先尝试打印出state_file的内容以便调试
261
  import logging
@@ -351,7 +351,7 @@ async def api_debug_state(session_id: str):
351
 
352
  try:
353
  # 加载状态
354
- state_file = np.load(state_path, allow_pickle=True)
355
 
356
  # 提取调试信息
357
  debug_info = {
 
253
  if not os.path.exists(user_dir):
254
  raise HTTPException(status_code=404, detail="Session not found")
255
 
256
+ # 加载状态 - 添加encoding参数
257
  state_path = os.path.join(user_dir, 'state.npz')
258
+ state_file = np.load(state_path, allow_pickle=True, encoding='latin1')
259
 
260
  # 首先尝试打印出state_file的内容以便调试
261
  import logging
 
351
 
352
  try:
353
  # 加载状态
354
+ state_file = np.load(state_path, allow_pickle=True, encoding='latin1')
355
 
356
  # 提取调试信息
357
  debug_info = {