from openai import OpenAI
# autodl 中指令
# # Set OpenAI's API key and API base to use vLLM's API server.
openai_api_key = "EMPTY"
openai_api_base = "http://localhost:8000/v1"
client = OpenAI(
api_key=openai_api_key,
base_url=openai_api_base,
)
chat_response = client.chat.completions.create(
model="Meta-Llama-3-8B-Instruct",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": 'how are you?'},
]
)
print("Chat response:", chat_response.choices)
#环境lora
#微调代码,启动服务器
#CUDA_VISIBLE_DEVICES=0 API_PORT=8000 llamafactory-cli api --model_name_or_path /media/ldx/陈启的机械硬盘/models/Llama3-8B-Chinese-Chat-cq --template llama3 --infer_backend vllm --vllm_enforce_eager
llamafactory调用model
最新推荐文章于 2026-03-04 00:13:03 发布

429

被折叠的 条评论
为什么被折叠?



