ffreemt commited on
Commit
8ac7a2e
β€’
1 Parent(s): 9726652

Update gr.Column scale=0.3, befoer trying stream with then

Browse files
Files changed (2) hide show
  1. .flake8 +8 -8
  2. app.py +4 -5
.flake8 CHANGED
@@ -2,7 +2,7 @@
2
  ignore =
3
  # E203 whitespace before ':'
4
  E203
5
- D203,
6
  # line too long
7
  E501
8
  per-file-ignores =
@@ -10,12 +10,12 @@ per-file-ignores =
10
  # __init__.py: F401
11
  test_*.py: F401
12
  exclude =
13
- .git,
14
- __pycache__,
15
- docs/source/conf.py,
16
- old,
17
- build,
18
- dist,
19
  .venv
20
- pad*.py
21
  max-complexity = 25
 
2
  ignore =
3
  # E203 whitespace before ':'
4
  E203
5
+ D203
6
  # line too long
7
  E501
8
  per-file-ignores =
 
10
  # __init__.py: F401
11
  test_*.py: F401
12
  exclude =
13
+ .git
14
+ __pycache__
15
+ docs/source/conf.py
16
+ old
17
+ build
18
+ dist
19
  .venv
20
+ pad*.py app-.py
21
  max-complexity = 25
app.py CHANGED
@@ -71,7 +71,6 @@ def predict0(prompt, bot):
71
  f"{atime.duration/(len(prompt) + len(response)):.1f}s/char)" # type: ignore
72
  )
73
 
74
- # bot[-1] = [prompt, f"{response} {_}"]
75
  bot.append([prompt, f"{response} {_}"])
76
 
77
  return prompt, bot
@@ -342,7 +341,7 @@ css = """
342
 
343
  with gr.Blocks(
344
  title="mpt-30b-chat-ggml",
345
- theme=gr.themes.Soft(text_size="sm"),
346
  css=css,
347
  ) as block:
348
  with gr.Accordion("🎈 Info", open=False):
@@ -361,7 +360,7 @@ with gr.Blocks(
361
  elem_classes="xsmall",
362
  )
363
  conversation = Chat()
364
- chatbot = gr.Chatbot().style(height=700) # 500
365
  buff = gr.Textbox(show_label=False)
366
  with gr.Row():
367
  with gr.Column():
@@ -370,11 +369,11 @@ with gr.Blocks(
370
  placeholder="Ask me anything (press Enter or click Submit to send)",
371
  show_label=False,
372
  ).style(container=False)
373
- with gr.Column():
374
  with gr.Row():
375
  submit = gr.Button("Submit", elem_classes="xsmall")
376
  stop = gr.Button("Stop", visible=False)
377
- clear = gr.Button("Clear", visible=True)
378
  with gr.Row(visible=False):
379
  with gr.Accordion("Advanced Options:", open=False):
380
  with gr.Row():
 
71
  f"{atime.duration/(len(prompt) + len(response)):.1f}s/char)" # type: ignore
72
  )
73
 
 
74
  bot.append([prompt, f"{response} {_}"])
75
 
76
  return prompt, bot
 
341
 
342
  with gr.Blocks(
343
  title="mpt-30b-chat-ggml",
344
+ theme=gr.themes.Soft(text_size="sm", spacing_size="sm"),
345
  css=css,
346
  ) as block:
347
  with gr.Accordion("🎈 Info", open=False):
 
360
  elem_classes="xsmall",
361
  )
362
  conversation = Chat()
363
+ chatbot = gr.Chatbot(scroll_to_output=True).style(height=700) # 500
364
  buff = gr.Textbox(show_label=False)
365
  with gr.Row():
366
  with gr.Column():
 
369
  placeholder="Ask me anything (press Enter or click Submit to send)",
370
  show_label=False,
371
  ).style(container=False)
372
+ with gr.Column(scale=0.3):
373
  with gr.Row():
374
  submit = gr.Button("Submit", elem_classes="xsmall")
375
  stop = gr.Button("Stop", visible=False)
376
+ clear = gr.Button("Clear History", visible=True)
377
  with gr.Row(visible=False):
378
  with gr.Accordion("Advanced Options:", open=False):
379
  with gr.Row():