ffreemt commited on
Commit
b01b8ee
1 Parent(s): e92ff33
Files changed (2) hide show
  1. .ruff.toml +21 -0
  2. app.py +3 -5
.ruff.toml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Assume Python 3.10.
2
+ target-version = "py310"
3
+ # Decrease the maximum line length to 79 characters.
4
+ line-length = 300
5
+
6
+ # pyflakes, pycodestyle, isort
7
+ # flake8 YTT, pydocstyle D, pylint PLC
8
+ select = ["F", "E", "W", "I001", "YTT", "D", "PLC"]
9
+ # select = ["ALL"]
10
+
11
+ # E501 Line too long
12
+ # D102 Missing docstring in public method
13
+ # D100 Missing docstring in public module
14
+ # E501 Line too long
15
+ # D103 Missing docstring in public function
16
+ # D101 Missing docstring in public class
17
+ # `multi-line-summary-first-line` (D212)
18
+ # `one-blank-line-before-class` (D203)
19
+ extend-ignore = ["E501", "D100", "D101", "D102", "D103", "D212", "D203"]
20
+
21
+ exclude = [".venv", "ultrachat-13B-test.py"]
app.py CHANGED
@@ -1,6 +1,4 @@
1
- """Credit to https://github.com/THUDM/ChatGLM2-6B/blob/main/web_demo.py
2
- while mistakes are mine
3
- """
4
  # pylint: disable=broad-exception-caught, redefined-outer-name, missing-function-docstring, missing-module-docstring, too-many-arguments, line-too-long, invalid-name, redefined-builtin, redefined-argument-from-local
5
  # import gradio as gr
6
 
@@ -74,7 +72,7 @@ gr.Chatbot.postprocess = postprocess
74
 
75
 
76
  def parse_text(text):
77
- """copy from https://github.com/GaiZhenbiao/ChuanhuChatGPT/"""
78
  lines = text.split("\n")
79
  lines = [line for line in lines if line != ""]
80
  count = 0
@@ -383,4 +381,4 @@ with gr.Blocks(title="ChatGLM2-6B-int4", theme=gr.themes.Soft(text_size="sm")) a
383
  # leave one for api access
384
  # reduce to 3 if OOM
385
 
386
- block.queue(concurrency_count=4, max_size=20).launch(debug=True)
 
1
+ """Credit to https://github.com/THUDM/ChatGLM2-6B/blob/main/web_demo.py while mistakes are mine."""
 
 
2
  # pylint: disable=broad-exception-caught, redefined-outer-name, missing-function-docstring, missing-module-docstring, too-many-arguments, line-too-long, invalid-name, redefined-builtin, redefined-argument-from-local
3
  # import gradio as gr
4
 
 
72
 
73
 
74
  def parse_text(text):
75
+ """Copy from https://github.com/GaiZhenbiao/ChuanhuChatGPT/."""
76
  lines = text.split("\n")
77
  lines = [line for line in lines if line != ""]
78
  count = 0
 
381
  # leave one for api access
382
  # reduce to 3 if OOM
383
 
384
+ demo.queue(concurrency_count=4, max_size=20).launch(debug=True)