MingDoan commited on
Commit
bc8af09
·
1 Parent(s): da3175f

fix: Fix Fw service for VQA

Browse files
Files changed (2) hide show
  1. apps/apis/vqa/__init__.py +3 -2
  2. docker-compose.yaml +3 -3
apps/apis/vqa/__init__.py CHANGED
@@ -19,10 +19,11 @@ async def vision_question_answer(
19
  ):
20
  # Forward request
21
  fw_data = {
22
- "files": {"image": image.file, "question": question},
 
23
  }
24
  fw_response = forward_request(fw_index, fw_data, '/api/vqa/')
25
  if fw_response is not None:
26
- return {"answer": fw_response["data"]["answer"]}
27
 
28
  return {"answer": "VQA model is not available in this server"}
 
19
  ):
20
  # Forward request
21
  fw_data = {
22
+ "files": {"image": image.file},
23
+ "data": {"question": question}
24
  }
25
  fw_response = forward_request(fw_index, fw_data, '/api/vqa/')
26
  if fw_response is not None:
27
+ return {"answer": fw_response}
28
 
29
  return {"answer": "VQA model is not available in this server"}
docker-compose.yaml CHANGED
@@ -7,8 +7,8 @@ services:
7
  image: "gdscfptu/ai-service"
8
  ports:
9
  - "7860:7860"
10
- # volumes:
11
- # - .:${HOME}/app
12
- # - ${HOME}/app/env
13
  env_file:
14
  - ./.env
 
7
  image: "gdscfptu/ai-service"
8
  ports:
9
  - "7860:7860"
10
+ volumes:
11
+ - .:${HOME}/app
12
+ - ${HOME}/app/env
13
  env_file:
14
  - ./.env