当前位置: 首页 > wzjs >正文

做视频网站需要什么空间吗百度收录查询方法

做视频网站需要什么空间吗,百度收录查询方法,青岛市城乡和住房建设局,9块9 wordpress目录 步骤一、下载模型 步骤二、安装模型依赖包 步骤三、写代码 步骤四、运行代码 步骤五、中文提问 & 运行代码 步骤一、下载模型 安装下载命令 pip install modelscope 下载模型 modelscope download --model Qwen/Qwen3-8B --local_dir /root/autodl-tmp/Qwen…

目录

步骤一、下载模型

步骤二、安装模型依赖包

步骤三、写代码

步骤四、运行代码

步骤五、中文提问 & 运行代码


步骤一、下载模型

安装下载命令

pip install modelscope
 

下载模型
modelscope download --model Qwen/Qwen3-8B --local_dir /root/autodl-tmp/Qwen/Qwen3-8B

步骤二、安装模型依赖包

pip install transformers peft diffusers

步骤三、写代码

from modelscope import AutoModelForCausalLM, AutoTokenizermodel_name = "/root/autodl-tmp/Qwen/Qwen3-8B"# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name,torch_dtype="auto",device_map="auto"
)
# prepare the model input
prompt = "Give me a short introduction to large language model."
messages = [{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(messages,tokenize=False,add_generation_prompt=True,enable_thinking=True # Switches between thinking and non-thinking modes. Default is True.
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)# conduct text completion
generated_ids = model.generate(**model_inputs,max_new_tokens=32768
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist() # parsing thinking content
try:# rindex finding 151668 (</think>)index = len(output_ids) - output_ids[::-1].index(151668)
except ValueError:index = 0thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")print("thinking content:", thinking_content)
print("content:", content)

步骤四、运行代码

python startqw3.py

步骤五、中文提问 & 运行代码

from modelscope import AutoModelForCausalLM, AutoTokenizermodel_name = "/root/autodl-tmp/Qwen/Qwen3-8B"# load the tokenizer and the model
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name,torch_dtype="auto",device_map="auto"
)
# prepare the model input
prompt = "1.我今年42岁是个程序员。2.我三高,高血压高血糖高血脂。3.不算工资收入,我如何在最短的时间内赚够一百万。请用中文思考和回复"
messages = [{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(messages,tokenize=False,add_generation_prompt=True,enable_thinking=True # Switches between thinking and non-thinking modes. Default is True.
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)# conduct text completion
generated_ids = model.generate(**model_inputs,max_new_tokens=32768
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist() # parsing thinking content
try:# rindex finding 151668 (</think>)index = len(output_ids) - output_ids[::-1].index(151668)
except ValueError:index = 0thinking_content = tokenizer.decode(output_ids[:index], skip_special_tokens=True).strip("\n")
content = tokenizer.decode(output_ids[index:], skip_special_tokens=True).strip("\n")print("thinking content:", thinking_content)
print("content:", content)

http://www.dtcms.com/wzjs/262548.html

相关文章:

  • 现在什么视频网站做的最好厦门网站建设公司名单
  • 做网站包含什么职位品牌推广策划书范文案例
  • 网站建设flash设计百度seo优化服务
  • 云互联的网站名字网站建设开发
  • 十堰网站制作百度搜索广告投放
  • 网站团购活动页面怎么做b2b多平台一键发布
  • 凡科网域名续费长沙关键词优化费用
  • 响水哪家专业做网站电商网络销售是做什么
  • 杭州电商网站平台开发公司成都网站快速排名软件
  • 做网站建设需要做哪些工作室校园推广
  • 网站建设公司 知道万维科技竞价推广渠道
  • 大连网站推广网站策划方案
  • 公职人员可以做网站吗大数据精准客户
  • wordpress.confseo关键字优化技巧
  • wordpress放作品seo前景
  • 雅安做网站的公司聊城疫情最新消息
  • 会计证继续教育在哪个网站做营销推广的主要方法
  • 室内设计师联盟网站象山seo外包服务优化
  • 商丘网站推广渠道优化网站视频
  • 戚墅堰常州做网站服装店营销策划方案
  • 如何找企业联系做网站内蒙古seo
  • 免费高清视频素材网站海南百度竞价排名
  • 外贸网站建设注意什么seo培训教程
  • 用中文模版可以做英文网站吗网站设计制作培训
  • 北海哪里做网站建设电工培训技术学校
  • 杭州电商网站建设seo的范畴是什么
  • 个人简历代写广州优化疫情防控措施
  • 网站游戏下载win7优化工具哪个好用
  • 上合建设网站企业chrome google
  • 做展示型企业网站东莞网络推广排名