From cd1d2169d3d243f13caafc6c65f7522dc573552f Mon Sep 17 00:00:00 2001 From: Letong Han <106566639+letonghan@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:43:17 +0800 Subject: [PATCH] add copyright for doc summary (#16) * add copyright for doc summary Signed-off-by: LetongHan * Fix copyright for shell and docker files Signed-off-by: lvliang-intel * update shell Signed-off-by: lvliang-intel --------- Signed-off-by: LetongHan Signed-off-by: lvliang-intel Co-authored-by: lvliang-intel --- DocSum/langchain/docker/Dockerfile | 14 ++++++++++++++ DocSum/langchain/docker/build_docker.sh | 14 ++++++++++++++ .../langchain/docker/summarize-app/Dockerfile | 15 +++++++++++++++ .../docker/summarize-app/app/__init__.py | 16 ++++++++++++++++ .../docker/summarize-app/app/server.py | 17 +++++++++++++++++ .../langchain/docker/summarize-app/app/utils.py | 17 +++++++++++++++++ DocSum/serving/tgi_gaudi/build_docker.sh | 13 +++++++++++++ DocSum/serving/tgi_gaudi/launch_tgi_service.sh | 13 +++++++++++++ 8 files changed, 119 insertions(+) diff --git a/DocSum/langchain/docker/Dockerfile b/DocSum/langchain/docker/Dockerfile index b91c264c..1959769f 100644 --- a/DocSum/langchain/docker/Dockerfile +++ b/DocSum/langchain/docker/Dockerfile @@ -1,3 +1,17 @@ +# Copyright (c) 2024 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + FROM langchain/langchain ARG http_proxy diff --git a/DocSum/langchain/docker/build_docker.sh b/DocSum/langchain/docker/build_docker.sh index aed4b47e..57363b2f 100755 --- a/DocSum/langchain/docker/build_docker.sh +++ b/DocSum/langchain/docker/build_docker.sh @@ -1,3 +1,17 @@ #!/bin/bash +# Copyright (c) 2024 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + docker build . -t document-summarize:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy diff --git a/DocSum/langchain/docker/summarize-app/Dockerfile b/DocSum/langchain/docker/summarize-app/Dockerfile index bbdeea13..4a2179bc 100644 --- a/DocSum/langchain/docker/summarize-app/Dockerfile +++ b/DocSum/langchain/docker/summarize-app/Dockerfile @@ -1,3 +1,18 @@ +# Copyright (c) 2024 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + FROM python:3.11-slim RUN pip install poetry==1.6.1 diff --git a/DocSum/langchain/docker/summarize-app/app/__init__.py b/DocSum/langchain/docker/summarize-app/app/__init__.py index e69de29b..1e8078e9 100644 --- a/DocSum/langchain/docker/summarize-app/app/__init__.py +++ b/DocSum/langchain/docker/summarize-app/app/__init__.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/DocSum/langchain/docker/summarize-app/app/server.py b/DocSum/langchain/docker/summarize-app/app/server.py index 477c95d0..3bf13f30 100644 --- a/DocSum/langchain/docker/summarize-app/app/server.py +++ b/DocSum/langchain/docker/summarize-app/app/server.py @@ -1,3 +1,20 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os from fastapi import FastAPI, APIRouter, Request, UploadFile, File from fastapi.responses import RedirectResponse, StreamingResponse diff --git a/DocSum/langchain/docker/summarize-app/app/utils.py b/DocSum/langchain/docker/summarize-app/app/utils.py index e3d80bab..70ea1bef 100644 --- a/DocSum/langchain/docker/summarize-app/app/utils.py +++ b/DocSum/langchain/docker/summarize-app/app/utils.py @@ -1,3 +1,20 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# +# Copyright (c) 2024 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + from bs4 import BeautifulSoup import docx2txt from langchain.document_loaders import PyPDFLoader diff --git a/DocSum/serving/tgi_gaudi/build_docker.sh b/DocSum/serving/tgi_gaudi/build_docker.sh index cd63bf81..3544d8c2 100644 --- a/DocSum/serving/tgi_gaudi/build_docker.sh +++ b/DocSum/serving/tgi_gaudi/build_docker.sh @@ -1,4 +1,17 @@ #!/bin/bash +# Copyright (c) 2024 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. git clone https://github.com/huggingface/tgi-gaudi.git cd ./tgi-gaudi/ diff --git a/DocSum/serving/tgi_gaudi/launch_tgi_service.sh b/DocSum/serving/tgi_gaudi/launch_tgi_service.sh index b4e795be..7bab7a6e 100644 --- a/DocSum/serving/tgi_gaudi/launch_tgi_service.sh +++ b/DocSum/serving/tgi_gaudi/launch_tgi_service.sh @@ -1,4 +1,17 @@ #!/bin/bash +# Copyright (c) 2024 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # Set default values default_port=8080