Created
February 21, 2024 02:53
-
-
Save zhangw/1a6b535c111aae22215d499b7123189d to your computer and use it in GitHub Desktop.
Revisions
-
zhangw created this gist
Feb 21, 2024 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ # 启动测试 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)