-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
new
from openai import OpenAI
client = OpenAI(
api_key="irrelevant", # this must set
base_url = "https://api.kastan.ai/v1" # this must set
)
def custom_completion(prompt):
completion = client.completions.create(
model="llama-2-7b",
prompt=prompt,
max_tokens=200,
temperature=0.7,
stream=True)
# ⚡️⚡️ streaming
for token in completion:
print(token.choices[0].text, end='')
custom_completion("what is the capital of france?")
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels