Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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):
|