Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

最新的代码中,在API推理的时候在yaml文件中的参数不起作用 #4674

Closed
1 task done
SafeCool opened this issue Jul 4, 2024 · 5 comments
Closed
1 task done
Labels
solved This problem has been already solved

Comments

@SafeCool
Copy link

SafeCool commented Jul 4, 2024

Reminder

  • I have read the README and searched the existing issues.

System Info

  • llamafactory version: 0.8.2.dev0
  • Platform: Linux-5.4.119-19-0009.11-x86_64-with-glibc2.35
  • Python version: 3.11.7
  • PyTorch version: 2.3.0+cu121 (GPU)
  • Transformers version: 4.41.2
  • Datasets version: 2.19.2
  • Accelerate version: 0.30.1
  • PEFT version: 0.11.1
  • TRL version: 0.8.6
  • GPU type: NVIDIA Graphics Device
  • DeepSpeed version: 0.14.0
  • vLLM version: 0.4.3

Reproduction

部署API的yam文件
model_name_or_path: /mnt/sft_full_qwen2_7B_Instruct_v4/checkpoint-100
template: qwen
cutoff_len: 4096
do_sample: false
部署结果
image

Expected behavior

No response

Others

No response

@github-actions github-actions bot added the pending This problem is yet to be addressed label Jul 4, 2024
@hiyouga
Copy link
Owner

hiyouga commented Jul 4, 2024

api 需要在 curl 时候给出 do_sample

@hiyouga hiyouga added solved This problem has been already solved and removed pending This problem is yet to be addressed labels Jul 4, 2024
@hiyouga hiyouga closed this as completed Jul 4, 2024
@SafeCool
Copy link
Author

SafeCool commented Jul 4, 2024

api 需要在 curl 时候给出 do_sample
通过这个命令部署的openai
CUDA_VISIBLE_DEVICES=0,1 API_PORT=8900 llamafactory-cli api /mnt/qwen2_7b_full_chat_v2.yaml
通过result = client.chat.completions.create(messages=messages, model="qwen", tools=tools,tool_choice="auto",top_p=0)
生成回复,中间哪里能设置do_sample 呢?

@hiyouga
Copy link
Owner

hiyouga commented Jul 4, 2024

我们之后修复一下。

@hiyouga hiyouga added pending This problem is yet to be addressed and removed solved This problem has been already solved labels Jul 4, 2024
@hiyouga hiyouga reopened this Jul 4, 2024
@hiyouga hiyouga added solved This problem has been already solved and removed pending This problem is yet to be addressed labels Jul 4, 2024
@hiyouga hiyouga closed this as completed in ed23231 Jul 4, 2024
@SafeCool
Copy link
Author

SafeCool commented Jul 7, 2024

我们之后修复一下。
使用最新的代码,好像还是不起作用,我的yaml文件是这样的,请问是写的不对吗?
model_name_or_path: /mnt/qwen2_7B_Instruct_v4/checkpoint-250
template: qwen
cutoff_len: 4096
do_sample: false

@SafeCool
Copy link
Author

SafeCool commented Jul 8, 2024

我们之后修复一下。

result = client.chat.completions.create(messages=messages, model="qwen", tools=tools,tool_choice="auto",top_p=0.2,temperature=0,do_sample=False)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/root/anaconda3/lib/python3.11/site-packages/openai/_utils/_utils.py", line 277, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
TypeError: Completions.create() got an unexpected keyword argument 'do_sample'

xtchen96 pushed a commit to xtchen96/LLaMA-Factory that referenced this issue Jul 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solved This problem has been already solved
Projects
None yet
Development

No branches or pull requests

2 participants