wolverinn commited on
Commit
5ed6d89
1 Parent(s): 4bbe159

fix lightning

Browse files
Files changed (4) hide show
  1. README.md +1 -1
  2. app.py +1 -1
  3. requirements.txt +6 -9
  4. requirements_hugging.txt +38 -0
README.md CHANGED
@@ -40,7 +40,7 @@ consider deploy on:
40
  > docs: [code](https://lightning.ai/docs/app/stable/levels/basic/real_lightning_component_implementations.html), [deploy](https://lightning.ai/docs/app/stable/workflows/run_app_on_cloud/)
41
 
42
  - requirements:
43
- - pip packages are listed in `requirements.txt`, note that some requirements are different from those in huggingface, and you need to modify some lines in `requirements.txt` according to the comment in the `requirements.txt`
44
  - other pip packages, system packages and some big model weight files download commands, can be listed using a custom build config. Checkout `class CustomBuildConfig(BuildConfig)` in `app.py`. In a custom build config you can use many linux commands such as `wget` and `sudo apt-get update`. The custom build config will be executed on the `__init__()` of the `PythonServer` class
45
  - `init()` and `predict()` function: use `app.py`, implement the `PythonServer` class. Note:
46
  - some packages haven't been installed when the file is called(these packages may be installed when `__init__()` is called), so some import code should be in the function, not at the top of the file, or you may get import errors.
 
40
  > docs: [code](https://lightning.ai/docs/app/stable/levels/basic/real_lightning_component_implementations.html), [deploy](https://lightning.ai/docs/app/stable/workflows/run_app_on_cloud/)
41
 
42
  - requirements:
43
+ - pip packages are listed in `requirements_lightning.txt`, because some requirements are different from those in huggingface. Rename it to `requirements.txt`
44
  - other pip packages, system packages and some big model weight files download commands, can be listed using a custom build config. Checkout `class CustomBuildConfig(BuildConfig)` in `app.py`. In a custom build config you can use many linux commands such as `wget` and `sudo apt-get update`. The custom build config will be executed on the `__init__()` of the `PythonServer` class
45
  - `init()` and `predict()` function: use `app.py`, implement the `PythonServer` class. Note:
46
  - some packages haven't been installed when the file is called(these packages may be installed when `__init__()` is called), so some import code should be in the function, not at the top of the file, or you may get import errors.
app.py CHANGED
@@ -43,7 +43,7 @@ class CustomBuildConfig(BuildConfig):
43
  cmd_31 = "sudo apt-get update"
44
  cmd3 = "sudo apt-get install libgl1-mesa-glx"
45
  cmd4 = "sudo apt-get install libglib2.0-0"
46
- return [download_cmd, down2, down3, down4, cmd1, cmd2, cmd_31, cmd3, cmd4]
47
 
48
 
49
  class PyTorchServer(PythonServer):
 
43
  cmd_31 = "sudo apt-get update"
44
  cmd3 = "sudo apt-get install libgl1-mesa-glx"
45
  cmd4 = "sudo apt-get install libglib2.0-0"
46
+ return [download_cmd, down2, down3, down4, cmd_31, cmd3, cmd4]
47
 
48
 
49
  class PyTorchServer(PythonServer):
requirements.txt CHANGED
@@ -1,3 +1,4 @@
 
1
  blendmodes==2022
2
  transformers==4.25.1
3
  accelerate==0.12.0
@@ -7,15 +8,11 @@ gradio==3.16.2
7
  numpy==1.23.3
8
  Pillow==9.4.0
9
  realesrgan==0.3.0
10
- # !!!!option1: if you use huggingface, you should use the following lines
11
- # !!!!option2: if you use lightning ai, you should comment the following lines
12
- lightning-api-access
13
- # torch==1.13.1+cu117
14
- # --extra-index-url https://download.pytorch.org/whl/cu117
15
- # torchvision==0.14.1+cu117
16
- # --extra-index-url https://download.pytorch.org/whl/cu117
17
  omegaconf==2.2.3
 
18
  pytorch_lightning==1.7.6
 
19
  scikit-image==0.19.2
20
  fonts
21
  font-roboto
@@ -23,7 +20,7 @@ timm==0.6.7
23
  piexif==1.1.3
24
  einops==0.4.1
25
  jsonmerge==1.8.0
26
- clean-fid==0.1.29
27
  resize-right==0.0.2
28
  torchdiffeq==0.2.3
29
  kornia==0.6.7
@@ -33,6 +30,6 @@ GitPython==3.1.27
33
  torchsde==0.2.5
34
  safetensors==0.2.7
35
  httpcore<=0.15
36
- fastapi==0.90.1
37
  git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b
38
  git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1
 
1
+ # this one is for lightning.ai
2
  blendmodes==2022
3
  transformers==4.25.1
4
  accelerate==0.12.0
 
8
  numpy==1.23.3
9
  Pillow==9.4.0
10
  realesrgan==0.3.0
11
+ #lightning-api-access
 
 
 
 
 
 
12
  omegaconf==2.2.3
13
+ requests>=2.26.0
14
  pytorch_lightning==1.7.6
15
+ lightning-api-access
16
  scikit-image==0.19.2
17
  fonts
18
  font-roboto
 
20
  piexif==1.1.3
21
  einops==0.4.1
22
  jsonmerge==1.8.0
23
+ clean-fid
24
  resize-right==0.0.2
25
  torchdiffeq==0.2.3
26
  kornia==0.6.7
 
30
  torchsde==0.2.5
31
  safetensors==0.2.7
32
  httpcore<=0.15
33
+ fastapi==0.88.0
34
  git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b
35
  git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1
requirements_hugging.txt ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # this one is for huggingface
2
+ blendmodes==2022
3
+ transformers==4.25.1
4
+ accelerate==0.12.0
5
+ basicsr==1.4.2
6
+ gfpgan==1.3.8
7
+ gradio==3.16.2
8
+ numpy==1.23.3
9
+ Pillow==9.4.0
10
+ realesrgan==0.3.0
11
+ # !!!!option1: if you use huggingface, you should use the following lines
12
+ # !!!!option2: if you use lightning ai, you should comment the following lines
13
+ torch==1.13.1+cu117
14
+ --extra-index-url https://download.pytorch.org/whl/cu117
15
+ torchvision==0.14.1+cu117
16
+ --extra-index-url https://download.pytorch.org/whl/cu117
17
+ omegaconf==2.2.3
18
+ pytorch_lightning==1.7.6
19
+ scikit-image==0.19.2
20
+ fonts
21
+ font-roboto
22
+ timm==0.6.7
23
+ piexif==1.1.3
24
+ einops==0.4.1
25
+ jsonmerge==1.8.0
26
+ clean-fid==0.1.29
27
+ resize-right==0.0.2
28
+ torchdiffeq==0.2.3
29
+ kornia==0.6.7
30
+ lark==1.1.2
31
+ inflection==0.5.1
32
+ GitPython==3.1.27
33
+ torchsde==0.2.5
34
+ safetensors==0.2.7
35
+ httpcore<=0.15
36
+ fastapi==0.90.1
37
+ git+https://github.com/mlfoundations/open_clip.git@bb6e834e9c70d9c27d0dc3ecedeebeaeb1ffad6b
38
+ git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1