gpt_academic icon indicating copy to clipboard operation
gpt_academic copied to clipboard

[Feature]: 如何连接LMstudio?

Open wjxxyz opened this issue 2 years ago • 0 comments

Class | 类型

大语言模型

Feature Request | 功能请求

我使用的是qwen1.5 32b,使用LMstdio启动并暴露接口,如果我想连接他,我应该调整哪些参数

Example: reuse your existing OpenAI setup

from openai import OpenAI

Point to the local server

client = OpenAI(base_url="http://localhost:12345/v1", api_key="lm-studio")

completion = client.chat.completions.create( model="Qwen/qwen1_5-14b-chat-q2_k", messages=[ {"role": "system", "content": "Always answer in rhymes."}, {"role": "user", "content": "Introduce yourself."} ], temperature=0.7, )

print(completion.choices[0].message)

wjxxyz avatar Apr 18 '24 03:04 wjxxyz