INNER CODE UNIT · Python
chat
tensorchord/modelz-llm · client.py:10
def chat():
chat_completion = openai.ChatCompletion.create(
model="fastchat-t5-3b-v1.0",
messages=[
{"role": "user", "content": "Who are you?"},
{"role": "assistant", "content": "I am a student"},
{"role": "user", "content": "What do you learn?"},
{"role": "assistant", "content": "I learn math"},
{"role": "user", "content": "Do you like english?"},
],
max_tokens=100,
)
print(chat_completion)
def embedding():
emb = openai.Embedding.create(
input=["Once upon a time", "There was a frog", "Who lived in a well"],