broadfield commited on
Commit
29a3f66
·
verified ·
1 Parent(s): df4924c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -132,10 +132,10 @@ def generate(prompt,history,mod=2,tok=4000,seed=1,role="ASSISTANT",data=None):
132
  return [{'role':'assistant','content': {'path':output}}]'''
133
  def parse_json(inp):
134
  if type(inp)==type(""):
 
135
  if "```" in inp:
136
  tog=False
137
  cnt=0
138
- lines=""
139
  for line in inp.split("\n"):
140
  if "```" in line:
141
  cnt+=1
@@ -145,9 +145,9 @@ def parse_json(inp):
145
  tog = False
146
  if tog==True:
147
  lines+=line
148
- try:
149
  print(lines)
150
  out_json=eval(lines)
 
151
  out1=out_json['filename']
152
  out2=out_json['filecontent']
153
  return out1,out2
 
132
  return [{'role':'assistant','content': {'path':output}}]'''
133
  def parse_json(inp):
134
  if type(inp)==type(""):
135
+ lines=""
136
  if "```" in inp:
137
  tog=False
138
  cnt=0
 
139
  for line in inp.split("\n"):
140
  if "```" in line:
141
  cnt+=1
 
145
  tog = False
146
  if tog==True:
147
  lines+=line
 
148
  print(lines)
149
  out_json=eval(lines)
150
+ try:
151
  out1=out_json['filename']
152
  out2=out_json['filecontent']
153
  return out1,out2