rootacess commited on
Commit
52c65f1
β€’
1 Parent(s): f956d6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -59,8 +59,18 @@ def generate(query: str, temperature=0.9, max_new_tokens=256, top_p=0.95, repeti
59
  previous_token = response.token.text
60
  yield output
61
  return output
62
- except errors.UnknownError:
63
- return "Please wait for a while, The OctoCoder model is currently loading... πŸ™"
 
 
 
 
 
 
 
 
 
 
64
 
65
 
66
  def process_example(**krwags):
 
59
  previous_token = response.token.text
60
  yield output
61
  return output
62
+ except errors.UnknownError as e:
63
+ print(f"Error: {e}")
64
+ message = "Please wait for a while, The OctoCoder model is currently loading... πŸ™"
65
+ output = ""
66
+ for item in message.split(" "):
67
+ if item == "πŸ™":
68
+ output += "πŸ™"
69
+ return output
70
+ else:
71
+ output += f"{item} "
72
+ yield output
73
+ return output
74
 
75
 
76
  def process_example(**krwags):