seanpedrickcase
commited on
Commit
β’
fcd826b
1
Parent(s):
2b16125
Added Lambda web adapter to Dockerfile. Updated Gradio version
Browse files- Dockerfile +4 -1
- README.md +1 -1
- app.py +0 -1
- how_to_create_exe_dist.txt +4 -1
Dockerfile
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
# First stage: build dependencies
|
2 |
FROM public.ecr.aws/docker/library/python:3.11.9-slim-bookworm
|
3 |
|
|
|
|
|
|
|
4 |
# Install wget
|
5 |
RUN apt-get update && apt-get install -y wget
|
6 |
|
@@ -14,7 +17,7 @@ COPY requirements.txt .
|
|
14 |
RUN pip install --no-cache-dir -r requirements.txt
|
15 |
|
16 |
# Gradio needs to be installed after due to conflict with spacy in requirements
|
17 |
-
RUN pip install --no-cache-dir gradio==4.
|
18 |
|
19 |
# Download the BGE embedding model during the build process
|
20 |
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
|
|
|
1 |
# First stage: build dependencies
|
2 |
FROM public.ecr.aws/docker/library/python:3.11.9-slim-bookworm
|
3 |
|
4 |
+
# Install Lambda web adapter in case you want to run with with an AWS Lamba function URL
|
5 |
+
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.3 /lambda-adapter /opt/extensions/lambda-adapter
|
6 |
+
|
7 |
# Install wget
|
8 |
RUN apt-get update && apt-get install -y wget
|
9 |
|
|
|
17 |
RUN pip install --no-cache-dir -r requirements.txt
|
18 |
|
19 |
# Gradio needs to be installed after due to conflict with spacy in requirements
|
20 |
+
RUN pip install --no-cache-dir gradio==4.32.2
|
21 |
|
22 |
# Download the BGE embedding model during the build process
|
23 |
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
|
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: π
|
|
4 |
colorFrom: purple
|
5 |
colorTo: green
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 4.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: apache-2.0
|
|
|
4 |
colorFrom: purple
|
5 |
colorTo: green
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 4.32.2
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
license: apache-2.0
|
app.py
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
from typing import Type
|
2 |
-
|
3 |
import gradio as gr
|
4 |
import pandas as pd
|
5 |
import numpy as np
|
|
|
1 |
from typing import Type
|
|
|
2 |
import gradio as gr
|
3 |
import pandas as pd
|
4 |
import numpy as np
|
how_to_create_exe_dist.txt
CHANGED
@@ -14,7 +14,10 @@ NOTE: for ensuring that spaCy models are loaded into the program correctly in re
|
|
14 |
|
15 |
9.Run the following, assuming you want to make one single .exe file (This helped me: https://github.com/pyinstaller/pyinstaller/issues/8108):
|
16 |
|
17 |
-
a) In command line: pyi-makespec --additional-hooks-dir="build_deps\\" --collect-data=gradio_client
|
|
|
|
|
|
|
18 |
|
19 |
b) Open the created spec file in Notepad. Add the following to the end of the Analysis section then save:
|
20 |
|
|
|
14 |
|
15 |
9.Run the following, assuming you want to make one single .exe file (This helped me: https://github.com/pyinstaller/pyinstaller/issues/8108):
|
16 |
|
17 |
+
a) In command line: pyi-makespec --additional-hooks-dir="build_deps\\" --collect-data=gradio_client --collect-data=gradio --hidden-import pyarrow.vendored.version --name DataSearchApp_0.4 app.py
|
18 |
+
|
19 |
+
# Add --onefile to the above if you would like everything packaged as a single exe, although this will need to be extracted upon starting the app, slowing down initialisation time significantly.
|
20 |
+
|
21 |
|
22 |
b) Open the created spec file in Notepad. Add the following to the end of the Analysis section then save:
|
23 |
|