Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add this to readme #4

Open
mail2harishemail opened this issue Nov 9, 2023 · 1 comment
Open

Add this to readme #4

mail2harishemail opened this issue Nov 9, 2023 · 1 comment

Comments

@mail2harishemail
Copy link

mail2harishemail commented Nov 9, 2023

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?")

@KastanDay
Copy link
Member

I think the format has changed in recent openai python package versions. I'll investigate which versions adhere to which behavior and update the README with 2 install methods (old package and new package). Thanks for the tip.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants