Omnibus commited on
Commit
495a8de
·
verified ·
1 Parent(s): 6ae156c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -101,6 +101,7 @@ def generate(prompt, history,max_new_tokens,health,temperature=temperature,top_p
101
 
102
  lines = output.strip().strip("\n").split("\n")
103
  skills=[]
 
104
  new_stat="*******************"
105
  for i,line in enumerate(lines):
106
  if ": " in line:
@@ -109,16 +110,18 @@ def generate(prompt, history,max_new_tokens,health,temperature=temperature,top_p
109
 
110
  skill_1 = line.split(": ")[1].split(" ")[0]
111
  skill_1=int(skill_1)
112
- skill ={lab_1:skill_1}
113
- skills.append(skill)
114
 
115
- new_stat += f'{lab_1}: {skill_1}'
116
 
117
  print(skills)
118
  except Exception as e:
119
  print (f'--Error :: {e}')
120
  print(f'Line:: {line}')
121
- stats=new_stat
 
 
122
  if history:
123
  history.append((prompt,output))
124
  yield "",history,stats,skills
 
101
 
102
  lines = output.strip().strip("\n").split("\n")
103
  skills=[]
104
+ skill_dict={}
105
  new_stat="*******************"
106
  for i,line in enumerate(lines):
107
  if ": " in line:
 
110
 
111
  skill_1 = line.split(": ")[1].split(" ")[0]
112
  skill_1=int(skill_1)
113
+ skill_dict[lab_1]=skill_1
114
+ #skill ={lab_1:skill_1}
115
 
116
+ new_stat += f'{lab_1}: {skill_1}\n'
117
 
118
  print(skills)
119
  except Exception as e:
120
  print (f'--Error :: {e}')
121
  print(f'Line:: {line}')
122
+ skills.append(skill_dict)
123
+
124
+ stats=new_stat+="*******************\n"
125
  if history:
126
  history.append((prompt,output))
127
  yield "",history,stats,skills