Skip to content

Commit

Permalink
Update client docs with new endpoint source (#126)
Browse files Browse the repository at this point in the history
Co-authored-by: Magdy Saleh <[email protected]>
  • Loading branch information
abidwael and magdyksaleh authored Dec 21, 2023
1 parent 3173826 commit 0881a49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion clients/python/lorax/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ def generate(
payload = resp.json()
if resp.status_code != 200:
raise parse_error(resp.status_code, payload)
return Response(**payload[0])
if isinstance(payload, list):
return Response(**payload[0])
return Response(**payload)

def generate_stream(
self,
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/python_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ Example:
```python
from lorax import Client

endpoint_url = f"https://api.app.predibase.com/v1/llms/{llm_deployment_name}"
# You can get your Predibase API token by going to Settings > My Profile > Generate API Token
# You can get your Predibase Tenant short code by going to Settings > My Profile > Overview > Tenant ID
endpoint_url = f"https://serving.app.predibase.com/{predibase_tenant_short_code}/deployments/v2/llms/{llm_deployment_name}/"
headers = {
"Authorization": f"Bearer {api_token}"
}
Expand Down

0 comments on commit 0881a49

Please sign in to comment.