Skip to content

Commit

Permalink
Update completions_streaming.py
Browse files Browse the repository at this point in the history
- random model selection is faulty - setting to a fixed instruct model
  • Loading branch information
mmikita95 committed Jun 28, 2024
1 parent a89843e commit cb406ce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/completions_streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
async def main() -> None:
client = AsyncClient()

print("Supported models:")
print("Available models:")
res = await client.models.list()
for model in res.models:
print(model.id)
Expand All @@ -27,7 +27,7 @@ async def main() -> None:
print(f"> {prompt}")
try:
stream_res = await client.completions.create(
model=random.choice(res.models).id,
model="palmyra-x-002-instruct",
prompt=prompt,
stream=True,
max_tokens=64,
Expand All @@ -36,7 +36,7 @@ async def main() -> None:
async for response in stream_res:
print(f"< {response.value}")

except BadRequestError as e:
except Exception as e:
print(f"Error: {e.body}")


Expand Down

0 comments on commit cb406ce

Please sign in to comment.