FritsLyneborg commited on
Commit
29c674a
1 Parent(s): f3cfd2b

2 dage tilbage

Browse files
.github/workflows/check_size.yml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Check file size
2
+
3
+ on:
4
+ pull_request:
5
+ branches: [main]
6
+
7
+ # to run this workflow manually from the Actions tab
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ sync-to-hub:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Check large files
15
+ uses: ActionsDesk/lfs-warning@v2.0
16
+ with:
17
+ filesizelimit: 10485760 # = 10MB, so we can sync to HF spaces
.github/workflows/style.yml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - uses: psf/black@stable
15
+ - uses: actions/setup-python@v2
16
+ with:
17
+ python-version: 3.9
18
+ - name: Install requirements
19
+ run: pip install ".[dev]"
20
+ - uses: jamescurtin/isort-action@master
.github/workflows/sync_to_hub.yml ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync to Hugging Face hub
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ # to run this workflow manually from the Actions tab
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ sync-to-hub:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ with:
16
+ fetch-depth: 0
17
+ - name: Push to hub
18
+ env:
19
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
20
+ run: git push https://boris:$HF_TOKEN@huggingface.co/spaces/flax-community/dalle-mini main
.github/workflows/sync_to_hub_debug.yml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Deploy to debug app
2
+
3
+ on:
4
+ # to run this workflow manually from the Actions tab
5
+ workflow_dispatch:
6
+
7
+ jobs:
8
+ sync-to-hub-debug:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v2
12
+ with:
13
+ fetch-depth: 0
14
+ - name: Push to hub
15
+ env:
16
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
17
+ run: git push --force https://boris:$HF_TOKEN@huggingface.co/spaces/flax-community/dalle-mini-debug +HEAD:main
README.md CHANGED
@@ -1,15 +1,14 @@
1
  ---
2
- title: DALL·E Fritsi
3
  emoji: 🥑
4
  colorFrom: yellow
5
  colorTo: green
6
  sdk: streamlit
7
  app_file: app/streamlit/app.py
8
  pinned: True
9
- license: apache-2.0
10
  ---
11
 
12
- # DALL·E Fritsi
13
 
14
  [![Join us on Discord](https://img.shields.io/discord/823813159592001537?color=5865F2&logo=discord&logoColor=white)](https://discord.gg/xBPBXfcFHd)
15
 
@@ -17,7 +16,7 @@ _Generate images from a text prompt_
17
 
18
  <img src="https://github.com/borisdayma/dalle-mini/raw/main/img/logo.png" width="200">
19
 
20
- Our logo was generated with DALL·E Fritsi using the prompt "logo of an armchair in the shape of an avocado".
21
 
22
  You can create your own pictures with [the demo](https://huggingface.co/spaces/flax-community/dalle-mini).
23
 
 
1
  ---
2
+ title: DALL·E mini
3
  emoji: 🥑
4
  colorFrom: yellow
5
  colorTo: green
6
  sdk: streamlit
7
  app_file: app/streamlit/app.py
8
  pinned: True
 
9
  ---
10
 
11
+ # DALL·E Mini
12
 
13
  [![Join us on Discord](https://img.shields.io/discord/823813159592001537?color=5865F2&logo=discord&logoColor=white)](https://discord.gg/xBPBXfcFHd)
14
 
 
16
 
17
  <img src="https://github.com/borisdayma/dalle-mini/raw/main/img/logo.png" width="200">
18
 
19
+ Our logo was generated with DALL·E mini using the prompt "logo of an armchair in the shape of an avocado".
20
 
21
  You can create your own pictures with [the demo](https://huggingface.co/spaces/flax-community/dalle-mini).
22
 
setup.cfg CHANGED
@@ -27,7 +27,6 @@ install_requires =
27
  einops
28
  unidecode
29
  ftfy
30
- emoji
31
  pillow
32
  jax
33
  flax
 
27
  einops
28
  unidecode
29
  ftfy
 
30
  pillow
31
  jax
32
  flax
src/dalle_mini/model/text.py CHANGED
@@ -8,7 +8,6 @@ import random
8
  import re
9
  from pathlib import Path
10
 
11
- import emoji
12
  import ftfy
13
  from huggingface_hub import hf_hub_download
14
  from unidecode import unidecode
@@ -214,8 +213,6 @@ class TextNormalizer:
214
  t = ftfy.fix_text(t)
215
  # fix html
216
  t = fix_html(t)
217
- # decode emojis (would be removed by unidecode)
218
- t = emoji.demojize(t)
219
  # decode and simplify text: see unidecode library
220
  t = unidecode(t)
221
  # lower case
 
8
  import re
9
  from pathlib import Path
10
 
 
11
  import ftfy
12
  from huggingface_hub import hf_hub_download
13
  from unidecode import unidecode
 
213
  t = ftfy.fix_text(t)
214
  # fix html
215
  t = fix_html(t)
 
 
216
  # decode and simplify text: see unidecode library
217
  t = unidecode(t)
218
  # lower case