Spaces:
Running
Running
Catch and show generation errors
Browse files
app.py
CHANGED
@@ -58,7 +58,10 @@ def generate(
|
|
58 |
seed = seed + 1
|
59 |
formatted_prompt = format_prompt(prompt, history, system_prompt)
|
60 |
|
61 |
-
|
|
|
|
|
|
|
62 |
output = ""
|
63 |
|
64 |
for response in stream:
|
|
|
58 |
seed = seed + 1
|
59 |
formatted_prompt = format_prompt(prompt, history, system_prompt)
|
60 |
|
61 |
+
try:
|
62 |
+
stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
|
63 |
+
except Exception as e:
|
64 |
+
raise gr.Error(f"Error while generating: {e}")
|
65 |
output = ""
|
66 |
|
67 |
for response in stream:
|