xyplon commited on
Commit
fec3b39
·
verified ·
1 Parent(s): 1fca24d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -44,6 +44,8 @@ def Hf():
44
  'model' : model,
45
  'style': style
46
  })
 
 
47
  for chunk in req.iter_lines():
48
  yield f'{chunk.decode()}\n'
49
  return Response(Gen(prompt=prompt,negative=negative,steps=steps,width=width,height=height,scale=scale,style=style,model=model), mimetype="text/event-stream")
 
44
  'model' : model,
45
  'style': style
46
  })
47
+ if(req.status!=200):
48
+ return "an error occurred! ", 500
49
  for chunk in req.iter_lines():
50
  yield f'{chunk.decode()}\n'
51
  return Response(Gen(prompt=prompt,negative=negative,steps=steps,width=width,height=height,scale=scale,style=style,model=model), mimetype="text/event-stream")