Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -57,4 +57,12 @@ iface = gr.Interface(
|
|
57 |
description="This tool allows querying the text retrieved from the URL using OpenAI's [text-davinci-003] engine.\nThe URL text can be referenced in the prompt as \"following text\".\nA GPT2 tokenizer is included to ensure that the 2000 token limit for OpenAI queries is not exceeded. Provide a prompt with your request, the url for text retrieval, your api-key and temperature to process the text."
|
58 |
)
|
59 |
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
description="This tool allows querying the text retrieved from the URL using OpenAI's [text-davinci-003] engine.\nThe URL text can be referenced in the prompt as \"following text\".\nA GPT2 tokenizer is included to ensure that the 2000 token limit for OpenAI queries is not exceeded. Provide a prompt with your request, the url for text retrieval, your api-key and temperature to process the text."
|
58 |
)
|
59 |
|
60 |
+
# captura de errores en la integración como componente
|
61 |
+
|
62 |
+
error_message = ""
|
63 |
+
|
64 |
+
try:
|
65 |
+
iface.launch()
|
66 |
+
except Exception as e:
|
67 |
+
error_message = "An error occurred: " + str(e)
|
68 |
+
iface.outputs[1].value = error_message
|