Skip to content

Conversation

@Ceng23333
Copy link
Contributor

  1. Unique Token 跟踪 (scripts/infer_task.py)

    • 添加 _unique_generated_tokens 集合来跟踪唯一 token ID
    • 修复:使用提示词 token 初始化(而非空集),以便提示词 token 也被惩罚
    • next() 生成新 token 时增量更新
    • get_unique_previous_tokens() 返回排序的唯一 token 数组
  2. 批处理层 (scripts/jiuge.py)

    • JiugeBatchedTask 从所有任务中收集唯一 token
    • 为 C++ API 创建扁平数组和指针数组
    • 高效处理每个请求的唯一 token 数组
  3. C++ 接口更新

    • 更新 inferBatchJiuge()inferBatch() 以接受 previous_tokens_per_reqprevious_tokens_len_per_req
    • 更新 InferRequest 结构体以包含唯一 token 字段
    • 更新 inferDeviceBatch()inferDeviceBatchPaged() 以传递唯一 token
    • 更新 InferenceContext::randomSample() 以接受并转发唯一 token
  4. Python 绑定 (scripts/libinfinicore_infer/jiuge.py)

    • 更新 inferBatchJiuge 参数类型以包含唯一 token 数组
    • 更新 infer_batch() 方法签名
  5. API 服务器 (scripts/launch_server.py)

    • 添加 --port--host 参数用于服务器配置
    • 添加 OpenAI 兼容的 /models 端点
    • 支持 chat_template_kwargs 透传

Signed-off-by: Ceng23333 <441651826@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants