Created
February 21, 2024 02:53
-
-
Save zhangw/1a6b535c111aae22215d499b7123189d to your computer and use it in GitHub Desktop.
codefuse-chatbot-test-local-llmapi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 启动测试 | |
import openai | |
openai.api_key = "" # Not support yet | |
openai.api_base = "http://127.0.0.1:18888/v1" | |
# 选择你启动的模型 | |
model = "codellama_34b" | |
# create a chat completion | |
completion = openai.ChatCompletion.create( | |
model=model, | |
messages=[{"role": "user", "content": "Hello! What is your name? "}], | |
max_tokens=100, | |
) | |
# print the completion | |
print(completion.choices[0].message.content) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment