You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting ReadTimeoutError while trying the following code,
from ragrank import evaluate
from ragrank.dataset import from_dict
from ragrank.metric import response_relevancy
# Define your dataset
data = from_dict({
"question": "What is the capital of France?",
"context": ["France is famous for its iconic landmarks such as the Eiffel Tower and its rich culinary tradition."],
"response": "The capital of France is Paris.",
})
# Evaluate the response relevance metric
result = evaluate(data, metrics=[response_relevancy])
# Display the evaluation results
result.to_dataframe()
output is like shown below
Evaluating : 100%|█████████████████████████████████████████████████| 1/1 remain: 00:00s, 1.42it/s
---------------------------------------------------------------------------
TimeoutError Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/urllib3/connectionpool.py](https://localhost:8080/#) in _make_request(self, conn, method, url, body, headers, retries, timeout, chunked, response_conn, preload_content, decode_content, enforce_content_length)
535 try:
--> 536 response = conn.getresponse()
537 except (BaseSSLError, OSError) as e:
26 frames
TimeoutError: The read operation timed out
The above exception was the direct cause of the following exception:
ReadTimeoutError Traceback (most recent call last)
ReadTimeoutError: HTTPSConnectionPool(host='ragrank-trace.onrender.com', port=443): Read timed out. (read timeout=10.0)
During handling of the above exception, another exception occurred:
ReadTimeout Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/requests/adapters.py](https://localhost:8080/#) in send(self, request, stream, timeout, verify, cert, proxies)
711 raise SSLError(e, request=request)
712 elif isinstance(e, ReadTimeoutError):
--> 713 raise ReadTimeout(e, request=request)
714 elif isinstance(e, _InvalidHeader):
715 raise InvalidHeader(e, request=request)
ReadTimeout: HTTPSConnectionPool(host='ragrank-trace.onrender.com', port=443): Read timed out. (read timeout=10.0)
I used a google colab for running the code.
The text was updated successfully, but these errors were encountered:
The ReadTimeoutError often indicates network issues or server-side delays
If you're running this on Google Colab and experiencing timeout issues, consider running the code on your local machine instead, if possible. Sometimes the cloud environment may have issues with network requests
from ragrank import evaluate
from ragrank.dataset import from_dict
from ragrank.metric import response_relevancy
from requests.exceptions import ReadTimeout
data = from_dict({
"question": "What is the capital of France?",
"context": ["France is famous for its iconic landmarks such as the Eiffel Tower and its rich culinary tradition."],
"response": "The capital of France is Paris.",
})
try:
# Evaluate the response relevance metric
result = evaluate(data, metrics=[response_relevancy])
# Display the evaluation results
df = result.to_dataframe()
print(df)
except ReadTimeout as e:
print(f"Request timed out: {e}")
Getting ReadTimeoutError while trying the following code,
output is like shown below
I used a google colab for running the code.
The text was updated successfully, but these errors were encountered: