JarrettYe commited on
Commit
3b21588
β€’
1 Parent(s): 1903448

udpate gradio sdk to 4.36.0

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +10 -12
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ‘
4
  colorFrom: purple
5
  colorTo: gray
6
  sdk: gradio
7
- sdk_version: 3.40.1
8
  app_file: app.py
9
  pinned: false
10
  license: mit
 
4
  colorFrom: purple
5
  colorTo: gray
6
  sdk: gradio
7
+ sdk_version: 4.36.0
8
  app_file: app.py
9
  pinned: false
10
  license: mit
app.py CHANGED
@@ -19,7 +19,7 @@ def interface_func(
19
  ratings.replace(" ", ""), request_retention
20
  )
21
  default_preview = optimizer.preview(request_retention)
22
- if delta_ts:
23
  s_history, d_history = memory_state_sequence(ratings, delta_ts, optimizer.w)
24
  return (
25
  test_sequence,
@@ -44,27 +44,25 @@ def memory_state_sequence(
44
  iface = gr.Interface(
45
  fn=interface_func,
46
  inputs=[
47
- gr.inputs.Textbox(
48
  label="weights",
49
  lines=1,
50
- default=str(DEFAULT_WEIGHT)[1:-1],
51
  ),
52
- gr.inputs.Textbox(label="ratings", lines=1, default="3,3,3,3,1,3,3"),
53
- gr.inputs.Textbox(
54
- label="delta_ts (requried by state history)", lines=1, optional=True
55
- ),
56
- gr.inputs.Slider(
57
  label="Your Request Retention",
58
  minimum=0.6,
59
  maximum=0.97,
60
  step=0.01,
61
- default=0.9,
62
  ),
63
  ],
64
  outputs=[
65
- gr.outputs.Textbox(label="test sequences"),
66
- gr.outputs.Textbox(label="default preview"),
67
- gr.outputs.Textbox(label="state history (require delta_ts)"),
68
  ],
69
  )
70
 
 
19
  ratings.replace(" ", ""), request_retention
20
  )
21
  default_preview = optimizer.preview(request_retention)
22
+ if delta_ts != "":
23
  s_history, d_history = memory_state_sequence(ratings, delta_ts, optimizer.w)
24
  return (
25
  test_sequence,
 
44
  iface = gr.Interface(
45
  fn=interface_func,
46
  inputs=[
47
+ gr.Textbox(
48
  label="weights",
49
  lines=1,
50
+ value=str(DEFAULT_WEIGHT)[1:-1],
51
  ),
52
+ gr.Textbox(label="ratings", lines=1, value="3,3,3,3,1,3,3"),
53
+ gr.Textbox(label="delta_ts (requried by state history)", lines=1, value=""),
54
+ gr.Slider(
 
 
55
  label="Your Request Retention",
56
  minimum=0.6,
57
  maximum=0.97,
58
  step=0.01,
59
+ value=0.9,
60
  ),
61
  ],
62
  outputs=[
63
+ gr.Textbox(label="test sequences"),
64
+ gr.Textbox(label="default preview"),
65
+ gr.Textbox(label="state history (require delta_ts)"),
66
  ],
67
  )
68