Spaces:
Running
Running
pengdaqian
commited on
Commit
•
b2502f7
1
Parent(s):
b4a01b7
fix
Browse files- Dockerfile +2 -0
- main.py +2 -1
Dockerfile
CHANGED
@@ -23,4 +23,6 @@ COPY --chown=user . $HOME/app
|
|
23 |
# cache model
|
24 |
RUN python3 warm_up.py
|
25 |
|
|
|
|
|
26 |
CMD ["sh", "-c", "python3 main.py"]
|
|
|
23 |
# cache model
|
24 |
RUN python3 warm_up.py
|
25 |
|
26 |
+
EXPOSE 7860
|
27 |
+
|
28 |
CMD ["sh", "-c", "python3 main.py"]
|
main.py
CHANGED
@@ -36,7 +36,8 @@ def write_scan_img_result(image_id: int, scans: List[int], img: str, callback: s
|
|
36 |
except Exception as ex:
|
37 |
print(ex)
|
38 |
|
39 |
-
nsfw_tags = map(lambda x: model.ImageScanTag(type="Moderation",
|
|
|
40 |
|
41 |
ret = model.ImageScanResponse(ok=True, error="", deleted=False, blockedFor=[], tags=nsfw_tags)
|
42 |
return ret
|
|
|
36 |
except Exception as ex:
|
37 |
print(ex)
|
38 |
|
39 |
+
nsfw_tags = list(map(lambda x: model.ImageScanTag(type="Moderation",
|
40 |
+
confidence=x['confidence']), nsfw_tags))
|
41 |
|
42 |
ret = model.ImageScanResponse(ok=True, error="", deleted=False, blockedFor=[], tags=nsfw_tags)
|
43 |
return ret
|