VishwaTechnologiesPvtLtd
commited on
Commit
·
e7077fc
1
Parent(s):
3750ba1
remote_server
Browse files- Dockerfile +3 -3
- backend/services/SentenceCheck.py +1 -1
Dockerfile
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
-
# Install
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
-
|
6 |
git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx \
|
7 |
curl fakeroot && \
|
8 |
rm -rf /var/lib/apt/lists/*
|
@@ -19,5 +19,5 @@ RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
|
19 |
WORKDIR /home/user/app
|
20 |
COPY . .
|
21 |
|
22 |
-
#
|
23 |
CMD ["python", "app.py"]
|
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
+
# Install Java (default-jre-headless is a safe option) + other deps
|
4 |
RUN apt-get update && apt-get install -y \
|
5 |
+
default-jre-headless \
|
6 |
git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx \
|
7 |
curl fakeroot && \
|
8 |
rm -rf /var/lib/apt/lists/*
|
|
|
19 |
WORKDIR /home/user/app
|
20 |
COPY . .
|
21 |
|
22 |
+
# App entrypoint
|
23 |
CMD ["python", "app.py"]
|
backend/services/SentenceCheck.py
CHANGED
@@ -8,7 +8,7 @@ nltk.download('punkt')
|
|
8 |
|
9 |
class SentenceCheck(ISentenceCheck):
|
10 |
def __init__(self):
|
11 |
-
self.tool = language_tool_python.LanguageTool('en-US')
|
12 |
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
13 |
print(f"[SentenceCheck] Using device: {self.device}")
|
14 |
self.model = GPT2LMHeadModel.from_pretrained("gpt2").to(self.device)
|
|
|
8 |
|
9 |
class SentenceCheck(ISentenceCheck):
|
10 |
def __init__(self):
|
11 |
+
self.tool = language_tool_python.LanguageTool('en-US', remote_server='https://api.languagetool.org')
|
12 |
self.device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
13 |
print(f"[SentenceCheck] Using device: {self.device}")
|
14 |
self.model = GPT2LMHeadModel.from_pretrained("gpt2").to(self.device)
|