ffreemt commited on
Commit
42d22c3
β€’
1 Parent(s): 2d9245d

Update prompt

Browse files
Files changed (2) hide show
  1. .ruff.toml +17 -0
  2. app.py +5 -6
.ruff.toml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ # D103 Missing docstring in public function
12
+ # D101 Missing docstring in public class
13
+ # `multi-line-summary-first-line` (D212)
14
+ # `one-blank-line-before-class` (D203)
15
+ extend-ignore = ["D103", "D101", "D212", "D203"]
16
+
17
+ exclude = [".venv"]
app.py CHANGED
@@ -55,14 +55,13 @@ This is a system prompt, please behave and help the user.
55
  prompt_template = """
56
  [INST] Write code to solve the following coding problem that obeys the constraints and
57
  passes the example test cases. Please wrap your code answer using ```:
58
-
59
  {question}
60
  [/INST]
61
  """
62
 
63
- human_prefix = "### Instruction"
64
- ai_prefix = "### Response"
65
- stop_list = [f"{human_prefix}:"]
66
 
67
  _ = psutil.cpu_count(logical=False) - 1
68
  cpu_count: int = int(_) if _ else 1
@@ -203,7 +202,7 @@ def bot(history):
203
  for elm in generate(user_message, config=config):
204
  if flag == 1:
205
  logger.debug("in the loop")
206
- prefix = f"({time.time() - then:.2f}s) "
207
  flag = 0
208
  print(prefix, end="", flush=True)
209
  logger.debug(f"{prefix=}")
@@ -280,7 +279,7 @@ with gr.Blocks(
280
  with gr.Accordion("🎈 Info", open=False):
281
  gr.Markdown(
282
  f"""<h5><center>{Path(model_loc).name}</center></h4>
283
- Doesn't quite work -- no output or run forever.""",
284
  elem_classes="xsmall",
285
  )
286
 
 
55
  prompt_template = """
56
  [INST] Write code to solve the following coding problem that obeys the constraints and
57
  passes the example test cases. Please wrap your code answer using ```:
 
58
  {question}
59
  [/INST]
60
  """
61
 
62
+ # human_prefix = "### Instruction"
63
+ # ai_prefix = "### Response"
64
+ # stop_list = [f"{human_prefix}:"]
65
 
66
  _ = psutil.cpu_count(logical=False) - 1
67
  cpu_count: int = int(_) if _ else 1
 
202
  for elm in generate(user_message, config=config):
203
  if flag == 1:
204
  logger.debug("in the loop")
205
+ prefix = f"({time.time() - then:.2f}s)\n"
206
  flag = 0
207
  print(prefix, end="", flush=True)
208
  logger.debug(f"{prefix=}")
 
279
  with gr.Accordion("🎈 Info", open=False):
280
  gr.Markdown(
281
  f"""<h5><center>{Path(model_loc).name}</center></h4>
282
+ Doesn't quite work yet -- no output or run forever. Maybe the system prompt is not in order. """,
283
  elem_classes="xsmall",
284
  )
285