deepseek-math-7b-instruct

我要开发同款
匿名用户2024年07月31日
54阅读

技术信息

官网地址
https://www.deepseek.com/
开源地址
https://modelscope.cn/models/deepseek-ai/deepseek-math-7b-instruct
授权协议
other

作品详情

DeepSeek Chat

[?Homepage] | [? Chat with DeepSeek LLM] | [Discord] | [Wechat(微信)]

Paper Lik?️


1. Itroductio to DeepSeekMath

See the Itroductio for more details.

2. How to Use

Here give some examples of how to use our model.

Chat Completio

❗❗❗ Please use chai-of-thought prompt to test DeepSeekMath-Istruct ad DeepSeekMath-RL:

  • Eglish questios: {questio}\Please reaso step by step, ad put your fial aswer withi \boxed{}.

  • Chiese questios: {questio}\请通过逐步推理来解答问题,并把最终答案放置于\boxed{}中。

import torch
from modelscope import AutoTokeizer, AutoModelForCausalLM, GeeratioCofig, sapshot_dowload

model_ame = "deepseek-ai/deepseek-math-7b-istruct"
model_ame = sapshot_dowload(model_ame, 'master')
tokeizer = AutoTokeizer.from_pretraied(model_ame)
model = AutoModelForCausalLM.from_pretraied(model_ame, torch_dtype=torch.bfloat16, device_map="auto")
model.geeratio_cofig = GeeratioCofig.from_pretraied(model_ame)
model.geeratio_cofig.pad_toke_id = model.geeratio_cofig.eos_toke_id

messages = [
    {"role": "user", "cotet": "what is the itegral of x^2 from 0 to 2?\Please reaso step by step, ad put your fial aswer withi \\boxed{}."}
]
iput_tesor = tokeizer.apply_chat_template(messages, add_geeratio_prompt=True, retur_tesors="pt")
outputs = model.geerate(iput_tesor.to(model.device), max_ew_tokes=100)

result = tokeizer.decode(outputs[0][iput_tesor.shape[1]:], skip_special_tokes=True)
prit(result)

Avoidig the use of the provided fuctio apply_chat_template, you ca also iteract with our model followig the sample template. Note that messages should be replaced by your iput.

User: {messages[0]['cotet']}

Assistat: {messages[1]['cotet']}<|ed▁of▁setece|>User: {messages[2]['cotet']}

Assistat:

Note: By default (add_special_tokes=True), our tokeizer automatically adds a bos_toke (<|begi▁of▁setece|>) before the iput text. Additioally, sice the system prompt is ot compatible with this versio of our models, we DO NOT RECOMMEND icludig the system prompt i your iput.

3. Licese

This code repository is licesed uder the MIT Licese. The use of DeepSeekMath models is subject to the Model Licese. DeepSeekMath supports commercial use.

See the LICENSE-MODEL for more details.

4. Cotact

If you have ay questios, please raise a issue or cotact us at service@deepseek.com.

功能介绍

[?Homepage] | [? Chat with DeepSeek LLM] | [Discord] | [Wechat(微信)] Paper Link?️ 1. Intr

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论