Spaces:
Runtime error
Runtime error
fix: Fix Fw service for VQA
Browse files- apps/apis/vqa/__init__.py +3 -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
|
|
|
23 |
}
|
24 |
fw_response = forward_request(fw_index, fw_data, '/api/vqa/')
|
25 |
if fw_response is not None:
|
26 |
-
return {"answer": fw_response
|
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 |
-
|
11 |
-
|
12 |
-
|
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
|