ThomasSimonini HF staff nlamot commited on
Commit
474e3e0
1 Parent(s): d625373

Handle accuracy data missing the spaces around +/- (#20)

Browse files

- Handle accuracy data missing the spaces around +/- (012b51027d4ab64d6716a46c3f367c6166cb569f)
- Fixed typo in rewards (b236f1164bdc08d658b4a29a0e828d02e8f71d79)


Co-authored-by: Nils Lamot <nlamot@users.noreply.huggingface.co>

Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -167,14 +167,13 @@ def parse_rewards(accuracy):
167
  default_reward=-1000
168
  if accuracy != None:
169
  accuracy = str(accuracy)
170
- parsed = accuracy.split(' +/- ')
171
  if len(parsed)>1:
172
- mean_reward = float(parsed[0])
173
- std_reward = float(parsed[1])
174
- elif len(parsed)==1: #only mean reward
175
- mean_reward = float(parsed[0])
176
- std_reward = float(0)
177
-
178
  else:
179
  mean_reward = float(default_std)
180
  std_reward = float(default_reward)
 
167
  default_reward=-1000
168
  if accuracy != None:
169
  accuracy = str(accuracy)
170
+ parsed = accuracy.split('+/-')
171
  if len(parsed)>1:
172
+ mean_reward = float(parsed[0].strip())
173
+ std_reward = float(parsed[1].strip())
174
+ elif len(parsed)==1: #only mean reward
175
+ mean_reward = float(parsed[0].strip())
176
+ std_reward = float(0)
 
177
  else:
178
  mean_reward = float(default_std)
179
  std_reward = float(default_reward)