Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def get_obj_status(self) -> str:
tries = 0
while not connected:
try:
response = requests.post(f"{self.server_url}/app/get_all_devices_status")
response = requests.post(f"{self.server_url}/app/get_all_devices_status", timeout=60)
connected = True
except Exception as e:
tries += 1
Expand All @@ -80,7 +80,7 @@ def predict(self, query: str, params: dict) -> typing.Generator[str, None, None]
data = {**defaults, **params}
url = (f"{self.server_url}/generate")
_LOGGER.debug("making request - %s", str({"server_url": url, "post_data": data}))
with requests.get(url, stream=True, json=data) as req:
with requests.get(url, stream=True, json=data, timeout=60) as req:
for chunk in req.iter_content():
yield chunk.decode("UTF-8")

Expand All @@ -102,4 +102,4 @@ def upload_documents(self, file_paths: typing.List[str]) -> None:
raise NotImplementedError

def search(self, prompt: str) -> typing.List[typing.Dict[str, typing.Union[str, float]]]:
raise NotImplementedError
raise NotImplementedError
4 changes: 2 additions & 2 deletions 4 experimental/fm-asr-streaming-rag/sdr-holoscan/riva_asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def run(self):

def _post_request(self, endpoint, data):
try:
client_response = requests.post(endpoint, json=data)
client_response = requests.post(endpoint, json=data, timeout=60)
self.logger.debug(f'Posted {data}, got response {client_response._content}')
self.logger.debug("--------------------------")
except requests.exceptions.ConnectionError:
Expand Down Expand Up @@ -143,4 +143,4 @@ def make_riva_request(self):
self._request_generator(),
metadata=self._riva_client.auth.get_auth_metadata()
)
return responses
return responses
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def nvolve_embedding(content, type="passage"):
payload = {"content": content}

# Making the POST request
response = requests.post(url, data=json.dumps(payload), headers=headers)
response = requests.post(url, data=json.dumps(payload), headers=headers, timeout=60)

# Check the response
if response.status_code == 200:
Expand Down
6 changes: 3 additions & 3 deletions 6 integrations/langchain/llms/nemo_infer.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def _call(
data, text_callback, **kwargs
)
try:
response = requests.post(self.server_url, json=data)
response = requests.post(self.server_url, json=data, timeout=60)
resp = response.json()
resp = resp.get("choices", [{}])[0].get("text", "")
return resp
Expand All @@ -132,7 +132,7 @@ def _streaming_request(
) -> str:
"""parse streaming response from nemo ms api
"""
response = requests.post(self.server_url, json=data, stream=True)
response = requests.post(self.server_url, json=data, stream=True, timeout=60)
current_string = ""
resp = ""

Expand All @@ -154,4 +154,4 @@ def _streaming_request(
if text_callback:
text_callback(resp)
current_string = chunk
return resp
return resp
2 changes: 1 addition & 1 deletion 2 integrations/langchain/llms/nv_api_catalog/chat_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _url_to_b64_string(image_source: str) -> str:
b64_template = "data:image/png;base64,{b64_string}"
try:
if _is_url(image_source):
response = requests.get(image_source)
response = requests.get(image_source, timeout=60)
response.raise_for_status()
encoded = base64.b64encode(response.content).decode("utf-8")
if sys.getsizeof(encoded) > 200000:
Expand Down
2 changes: 1 addition & 1 deletion 2 integrations/langchain/llms/nv_api_catalog/image_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def payload_fn(d):

def _get_pil_from_response(data: str) -> Image.Image:
if data.startswith("url: "):
body = requests.get(data[4:], stream=True).raw
body = requests.get(data[4:], stream=True, timeout=60).raw
elif data.startswith("b64_json: "):
body = BytesIO(base64.decodebytes(bytes(data[10:], "utf-8")))
else:
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.