hysts HF staff commited on
Commit
6191b08
β€’
1 Parent(s): c0495f9
Files changed (6) hide show
  1. .pre-commit-config.yaml +59 -49
  2. .vscode/settings.json +13 -4
  3. README.md +2 -1
  4. app.py +1 -1
  5. requirements.txt +5 -5
  6. style.css +2 -1
.pre-commit-config.yaml CHANGED
@@ -1,50 +1,60 @@
1
  repos:
2
- - repo: https://github.com/pre-commit/pre-commit-hooks
3
- rev: v4.4.0
4
- hooks:
5
- - id: check-executables-have-shebangs
6
- - id: check-json
7
- - id: check-merge-conflict
8
- - id: check-shebang-scripts-are-executable
9
- - id: check-toml
10
- - id: check-yaml
11
- - id: end-of-file-fixer
12
- - id: mixed-line-ending
13
- args: ["--fix=lf"]
14
- - id: requirements-txt-fixer
15
- - id: trailing-whitespace
16
- - repo: https://github.com/myint/docformatter
17
- rev: v1.7.5
18
- hooks:
19
- - id: docformatter
20
- args: ["--in-place"]
21
- - repo: https://github.com/pycqa/isort
22
- rev: 5.12.0
23
- hooks:
24
- - id: isort
25
- args: ["--profile", "black"]
26
- - repo: https://github.com/pre-commit/mirrors-mypy
27
- rev: v1.5.1
28
- hooks:
29
- - id: mypy
30
- args: ["--ignore-missing-imports"]
31
- additional_dependencies: ["types-python-slugify", "types-requests", "types-PyYAML"]
32
- - repo: https://github.com/psf/black
33
- rev: 23.9.1
34
- hooks:
35
- - id: black
36
- language_version: python3.10
37
- args: ["--line-length", "119"]
38
- - repo: https://github.com/kynan/nbstripout
39
- rev: 0.6.1
40
- hooks:
41
- - id: nbstripout
42
- args: ["--extra-keys", "metadata.interpreter metadata.kernelspec cell.metadata.pycharm"]
43
- - repo: https://github.com/nbQA-dev/nbQA
44
- rev: 1.7.0
45
- hooks:
46
- - id: nbqa-black
47
- - id: nbqa-pyupgrade
48
- args: ["--py37-plus"]
49
- - id: nbqa-isort
50
- args: ["--float-to-top"]
 
 
 
 
 
 
 
 
 
 
 
1
  repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.5.0
4
+ hooks:
5
+ - id: check-executables-have-shebangs
6
+ - id: check-json
7
+ - id: check-merge-conflict
8
+ - id: check-shebang-scripts-are-executable
9
+ - id: check-toml
10
+ - id: check-yaml
11
+ - id: end-of-file-fixer
12
+ - id: mixed-line-ending
13
+ args: ["--fix=lf"]
14
+ - id: requirements-txt-fixer
15
+ - id: trailing-whitespace
16
+ - repo: https://github.com/myint/docformatter
17
+ rev: v1.7.5
18
+ hooks:
19
+ - id: docformatter
20
+ args: ["--in-place"]
21
+ - repo: https://github.com/pycqa/isort
22
+ rev: 5.13.2
23
+ hooks:
24
+ - id: isort
25
+ args: ["--profile", "black"]
26
+ - repo: https://github.com/pre-commit/mirrors-mypy
27
+ rev: v1.8.0
28
+ hooks:
29
+ - id: mypy
30
+ args: ["--ignore-missing-imports"]
31
+ additional_dependencies:
32
+ [
33
+ "types-python-slugify",
34
+ "types-requests",
35
+ "types-PyYAML",
36
+ "types-pytz",
37
+ ]
38
+ - repo: https://github.com/psf/black
39
+ rev: 24.2.0
40
+ hooks:
41
+ - id: black
42
+ language_version: python3.10
43
+ args: ["--line-length", "119"]
44
+ - repo: https://github.com/kynan/nbstripout
45
+ rev: 0.7.1
46
+ hooks:
47
+ - id: nbstripout
48
+ args:
49
+ [
50
+ "--extra-keys",
51
+ "metadata.interpreter metadata.kernelspec cell.metadata.pycharm",
52
+ ]
53
+ - repo: https://github.com/nbQA-dev/nbQA
54
+ rev: 1.7.1
55
+ hooks:
56
+ - id: nbqa-black
57
+ - id: nbqa-pyupgrade
58
+ args: ["--py37-plus"]
59
+ - id: nbqa-isort
60
+ args: ["--float-to-top"]
.vscode/settings.json CHANGED
@@ -1,11 +1,16 @@
1
  {
 
 
2
  "[python]": {
3
  "editor.defaultFormatter": "ms-python.black-formatter",
4
  "editor.formatOnType": true,
5
  "editor.codeActionsOnSave": {
6
- "source.organizeImports": true
7
  }
8
  },
 
 
 
9
  "black-formatter.args": [
10
  "--line-length=119"
11
  ],
@@ -13,9 +18,13 @@
13
  "flake8.args": [
14
  "--max-line-length=119"
15
  ],
16
- "ruff.args": [
17
  "--line-length=119"
18
  ],
19
- "editor.formatOnSave": true,
20
- "files.insertFinalNewline": true
 
 
 
 
21
  }
 
1
  {
2
+ "editor.formatOnSave": true,
3
+ "files.insertFinalNewline": false,
4
  "[python]": {
5
  "editor.defaultFormatter": "ms-python.black-formatter",
6
  "editor.formatOnType": true,
7
  "editor.codeActionsOnSave": {
8
+ "source.organizeImports": "explicit"
9
  }
10
  },
11
+ "[jupyter]": {
12
+ "files.insertFinalNewline": false
13
+ },
14
  "black-formatter.args": [
15
  "--line-length=119"
16
  ],
 
18
  "flake8.args": [
19
  "--max-line-length=119"
20
  ],
21
+ "ruff.lint.args": [
22
  "--line-length=119"
23
  ],
24
+ "notebook.output.scrolling": true,
25
+ "notebook.formatOnCellExecution": true,
26
+ "notebook.formatOnSave.enabled": true,
27
+ "notebook.codeActionsOnSave": {
28
+ "source.organizeImports": "explicit"
29
+ }
30
  }
README.md CHANGED
@@ -4,11 +4,12 @@ emoji: πŸ“š
4
  colorFrom: purple
5
  colorTo: green
6
  sdk: gradio
7
- sdk_version: 3.47.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
  suggested_hardware: t4-small
 
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
4
  colorFrom: purple
5
  colorTo: green
6
  sdk: gradio
7
+ sdk_version: 4.19.2
8
  app_file: app.py
9
  pinned: false
10
  license: mit
11
  suggested_hardware: t4-small
12
+ short_description: text-to-image
13
  ---
14
 
15
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py CHANGED
@@ -97,7 +97,7 @@ with gr.Blocks(css="style.css") as demo:
97
  elem_id="duplicate-button",
98
  visible=os.getenv("SHOW_DUPLICATE_BUTTON") == "1",
99
  )
100
- with gr.Box():
101
  with gr.Row():
102
  prompt = gr.Text(
103
  label="Prompt",
 
97
  elem_id="duplicate-button",
98
  visible=os.getenv("SHOW_DUPLICATE_BUTTON") == "1",
99
  )
100
+ with gr.Group():
101
  with gr.Row():
102
  prompt = gr.Text(
103
  label="Prompt",
requirements.txt CHANGED
@@ -1,7 +1,7 @@
1
- accelerate==0.23.0
2
- diffusers==0.21.2
3
- gradio==3.47.0
4
- spaces==0.16.1
5
  torch==2.0.0
6
  torchvision==0.15.1
7
- transformers==4.34.0
 
1
+ accelerate==0.27.2
2
+ diffusers==0.26.3
3
+ gradio==4.19.2
4
+ spaces==0.23.2
5
  torch==2.0.0
6
  torchvision==0.15.1
7
+ transformers==4.38.1
style.css CHANGED
@@ -1,8 +1,9 @@
1
  h1 {
2
  text-align: center;
 
3
  }
4
 
5
- #component-0 {
6
  max-width: 730px;
7
  margin: auto;
8
  padding-top: 1.5rem;
 
1
  h1 {
2
  text-align: center;
3
+ display: block;
4
  }
5
 
6
+ .contain {
7
  max-width: 730px;
8
  margin: auto;
9
  padding-top: 1.5rem;