added docker volumes for faster development

This commit is contained in:
alpcentaur 2024-09-12 17:26:31 +02:00
parent 653684807a
commit 773c1fd765
27 changed files with 14 additions and 21 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
build/deb-rust-proto-interface/rust-proto-interface_safecopy
build/rust-proto-fastapi-server/Prototyp_safecopy

View file

@ -10,7 +10,7 @@ RUN echo "deb http://archive.debian.org/debian stretch main contrib non-free" >
RUN apt-get update && apt-get install -y \
build-essential checkinstall zlib1g-dev pkg-config libssl1.0-dev -y
COPY rust-proto-interface rust-proto-interface
#COPY rust-proto-interface rust-proto-interface
WORKDIR /opt/rust-proto-interface

View file

@ -36,7 +36,7 @@
"it": "basabuuka"
},
"index_title2": {
"en": "Open Language?",
"en": "Open Language!",
"fr": "ouvrir la langue?",
"de": "Sprache oeffnen?",
"it": "Aprire le lingue?"

View file

@ -147,7 +147,8 @@
if (xhr1.readyState == 4) {
result = xhr1.response.split('?&?&')
document.getElementById("output1").value = result[0].substring(3, result[0].length);
document.getElementById("output1").value = result[0].substring(3, result[0].length).replace(/\n/g, "<br>");
document.getElementById("output2").value = result[1].substring(0, result[1].length - 3);
document.getElementById("datextarea").value = text;
};

View file

@ -11,7 +11,7 @@ FROM tensorflow/tensorflow:2.2.0-gpu
#USER pluritonian
WORKDIR /home/pluritonian
WORKDIR /home/pluritonian/Prototyp
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/7fa2af80.pub
@ -29,7 +29,7 @@ RUN python -m spacy download de_core_news_sm
RUN pip install --upgrade pip && pip install fastapi uvicorn[standard]
COPY Prototyp/* /home/pluritonian/
#COPY Prototyp/* /home/pluritonian/
# to let the container running:

View file

@ -62,20 +62,8 @@ async def root(data: Request):
output = prototype.translate(text)
print(output)
outputlist = output.split(" ")
rezponse = ''
sentence = ''
for word in outputlist:
sentence += word
if '.' or '!' or '?' in word:
rezponse += sentence + ' \n '
sentence = ''
daresponse = output + '?&?&' + rezponse
daresponse = output + '?&?&' + "Future Input"
return JSONResponse(content=daresponse)

View file

@ -111,7 +111,7 @@ if len(outsentences) == len(punctuations):
for n in range(len(outsentences)):
outsentence = outsentences[n]
outsentence[0] = outsentence[0].title()
out += ' '.join(outsentence) + punctuations[n] + '\n'
out += ' '.join(outsentence) + punctuations[n] + '<br>'
print(out)

View file

@ -1,5 +1,3 @@
version: '3.1'
services:
@ -8,6 +6,8 @@ services:
build: ../build/rust-proto-fastapi-server
container_name: rust-proto-fastapi-server
restart: always
volumes:
- ../build/rust-proto-fastapi-server/Prototyp:/home/pluritonian/Prototyp
deploy:
resources:
reservations:
@ -20,6 +20,8 @@ services:
build: ../build/deb-rust-proto-interface
container_name: deb-rust-proto-interface
restart: always
volumes:
- ../build/deb-rust-proto-interface/rust-proto-interface:/opt/rust-proto-interface
environment:
- RUST_BACKTRACE=full
ports: