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

上传引用图片 网站wordpress 文字主题

上传引用图片 网站,wordpress 文字主题,网站除了域名还要什么用,工作室主题网站模板有时候我们会发现使用deepseek服务器,异常卡顿,这是由于多方面原因造成的,比如说访问人数过多等。想要解决这个问题,我们可以选择第三方平台进行部署 第三方平台 我们可以选择的第三方平台很多,比如硅基流动、秘塔搜索…

有时候我们会发现使用deepseek服务器,异常卡顿,这是由于多方面原因造成的,比如说访问人数过多等。想要解决这个问题,我们可以选择第三方平台进行部署

第三方平台

我们可以选择的第三方平台很多,比如硅基流动、秘塔搜索、百度千帆等,常见平台官网如下

  • 阿里云:https://pai.console.aliyun.com/#/quick-start/models.
  • 腾讯云:https://console.cloud.tencent.com/tione/v2/aimarket/detail/deepseek series?regionld=1&detailTab=introducee
  • cursor:https://cursor.com 需要cursor会员
  • grok:https://groq.com/蒸馏版llama 70b,中文能力不足
  • 国家超算中心:https://www.scnet.cn/ui/mall/
  • 硅基流动:https://siliconflow.cn/zh-cn/models

我们以硅基流动为例来介绍第三方平台部署

部署

  1. 打卡硅基流动官网,我们可以看到他可以使用的模型在这里插入图片描述

  2. 我们以V3模型为例来进行部署,点击第一行第二个模型,他会出现模型的详情信息在这里插入图片描述

  3. 我们可以在线体检,也可以看api文档进行部署,我们打开API文档,在左侧我们可以看到它支持的接口在这里插入图片描述,右侧就是相关的例子了

  4. 我们以创建文本对话为例来进行部署,以官网为例写下如下代码

import requestsurl = "https://api.siliconflow.cn/v1/chat/completions"payload = {"model": "Qwen/QwQ-32B","messages": [{"role": "user","content": "What opportunities and challenges will the Chinese large model industry face in 2025?"}],"stream": False,"max_tokens": 512,"stop": None,"temperature": 0.7,"top_p": 0.7,"top_k": 50,"frequency_penalty": 0.5,"n": 1,"response_format": {"type": "text"},"tools": [{"type": "function","function": {"description": "<string>","name": "<string>","parameters": {},"strict": False}}]
}
headers = {"Authorization": "Bearer <token>","Content-Type": "application/json"
}response = requests.request("POST", url, json=payload, headers=headers)print(response.text)

对于代码解释

这段代码是使用 Python 的 requests 库向 SiliconFlow API 发送一个 POST 请求,调用 Qwen/QwQ-32B 大语言模型,并获取其对 “2025年中国大模型产业面临的机遇与挑战” 这个问题的回答。

1. 请求目标(API 端点)
url = "https://api.siliconflow.cn/v1/chat/completions"

• 这是 SiliconFlow 提供的 Chat Completions API,用于与大模型对话。

2. 请求数据(Payload)
payload = {"model": "Qwen/QwQ-32B",  # 指定调用的模型"messages": [{"role": "user",  # 用户角色"content": "What opportunities and challenges will the Chinese large model industry face in 2025?"  # 用户提问}],"stream": False,  # 是否流式返回(False 表示一次性返回完整回答)"max_tokens": 512,  # 限制返回的最大 token 数量(防止回答过长)"temperature": 0.7,  # 控制回答的随机性(0-1,越高越有创意)"top_p": 0.7,  # 控制生成多样性(类似 temperature)"top_k": 50,  # 限制采样范围(仅从 top_k 个最可能的 token 中选择)"frequency_penalty": 0.5,  # 降低重复内容的概率"n": 1,  # 只生成 1 个回答"response_format": {"type": "text"},  # 返回纯文本格式"tools": [...]  # (可选)用于函数调用,但这里未实际使用
}

model: 指定调用的模型(这里是 Qwen/QwQ-32B)。
messages: 对话历史,这里只有用户的一条提问。
stream: 是否流式返回(False 表示一次性返回完整回答)。
max_tokens: 限制回答长度(防止过长)。
temperaturetop_ptop_k: 控制回答的随机性和多样性。
frequency_penalty: 减少重复内容。
tools: 可用于 函数调用(Function Calling)

3. 请求头(Headers)
headers = {"Authorization": "Bearer <token>",  # 替换为你的 API Key"Content-Type": "application/json"  # 告诉服务器发送的是 JSON 数据
}

Authorization: 需要替换 <token> 为你的 SiliconFlow API Key(否则会返回 401 未授权错误)。
Content-Type: 指定数据格式为 application/json

4. 发送请求
response = requests.request("POST", url, json=payload, headers=headers)

• 使用 requests.post() 发送 POST 请求,传递 payload(JSON 格式)和 headers(包含认证信息)。

5. 打印响应
print(response.text)

• 打印 API 返回的 JSON 格式 的完整响应。

对于各个参数的取值,官网会有更详细的说明,点击

申请API KEY

在代码中,我们需要替换<token>,也就是API KEY来进行正确的调用,所以我们应该先进行申请 API KEY

  1. 进入申请API KEY 的页面,并登录

  2. 点击新建API KEY 在这里插入图片描述

  3. 点击余额充值,我们可以看到剩余的金额在这里插入图片描述

  4. 新建好后,我们将API KEY替换,运行上面代码,得到如下回答

{"id": "0195e27f092c94bd150980adec837ef5","object": "chat.completion","created": 1743261731,"model": "Qwen/QwQ-32B","choices": [{"index": 0,"message": {"role": "assistant","content": "","reasoning_content": "Okay, the user is asking about the opportunities and challenges the Chinese large model industry will face in 2025. Hmm, I need to break this down. First, I should consider what tools are available. The provided functions might include something like a market analysis tool or a future prediction model.\n\ nLooking at the tools given,there 's a function called \"analyze_market_trends\" which takes parameters like region, industry, and year. That seems relevant here. The user is focusing on China's large model industry,so region would be\ "China\", industry \"AI/ML\" or \"Large Language Models\", and year 2025.\n\nWait, the parameters for analyze_market_trends include region (string), industry (string), year (integer), and maybe others like specific_subsector. Since the question is about large models specifically, maybe adding \"large language models\" as the specific_subsector would help narrow it down.\n\nI should also check if there's another function called \"predict_future_impact\" which takes technology (string), region (string), timeframe (string like \"2025\"), and factors like economic, regulatory. That could cover both opportunities and challenges by considering different factors.\n\nSo combining both functions might give a comprehensive answer. First use analyze_market_trends to get market trends in China's AI/ML sector focusing on large models by 2025. Then use predict_future_impact to look at technological, economic, regulatory factors affecting them.\n\nWait but the user's question is about opportunities and challenges specifically. The functions might already capture that in their outputs. Let me make sure each function's parameters are correctly filled. For analyze_market_trends: region China, industry \"AI/ML\", year 2025, specific_subsector \"large language models\". For predict_future_impact: technology \"large language models\", region China, timeframe \"2025\", factors including economic, regulatory, technological.\n\nI need to structure the tool calls correctly in XML tags as specified. Each tool_call should be separate. Let me format that properly.\n","tool_calls": [{"id": "0195e27f26b353d40e8c41265d8faa9f","type": "function","function": {"name": "analyze_market_trends","arguments": "{\"region\": \"China\", \"industry\": \"AI/ML\", \"year\": 2025, \"specific_subsector\": \"large language models\"}"}}]},"finish_reason": "tool_calls"}],"usage": {"prompt_tokens": 140,"completion_tokens": 512,"total_tokens": 652},"system_fingerprint": ""
}

文章转载自:

http://ohinNpdx.wmmqf.cn
http://2MLl3ir4.wmmqf.cn
http://dYkL952h.wmmqf.cn
http://5Hp6IvkF.wmmqf.cn
http://BTmqibJ7.wmmqf.cn
http://SFmz8a7s.wmmqf.cn
http://D7H5d82d.wmmqf.cn
http://9k7DSAol.wmmqf.cn
http://PG5AZt9U.wmmqf.cn
http://XBVQpUdD.wmmqf.cn
http://m4OuoH3P.wmmqf.cn
http://DoqFczC5.wmmqf.cn
http://xqn3PGjQ.wmmqf.cn
http://tshbHQrw.wmmqf.cn
http://YaVbv2m7.wmmqf.cn
http://6wIa1xRh.wmmqf.cn
http://8bnD8dJ1.wmmqf.cn
http://1yzm2qUl.wmmqf.cn
http://j2YuXXUd.wmmqf.cn
http://QKEJ7NOS.wmmqf.cn
http://lEIZ60ee.wmmqf.cn
http://iynqmyUW.wmmqf.cn
http://R6qVb0sZ.wmmqf.cn
http://1TmMmSww.wmmqf.cn
http://2lSXWzJr.wmmqf.cn
http://HkdKhQv8.wmmqf.cn
http://jVsmVkqB.wmmqf.cn
http://outmq0xl.wmmqf.cn
http://AfcxBfpg.wmmqf.cn
http://PlAUIkzt.wmmqf.cn
http://www.dtcms.com/wzjs/773929.html

相关文章:

  • 2023年做网站怎么样试述网站开发的流程
  • 建设部门网站如何做全景素材网站
  • 锦州网站做优化html 单页网站
  • 北京网站建设新闻微信音乐做mp3下载网站
  • 数码产品销售网站建设策划书个人免费开发网站
  • seo研究中心好客站Wordpress怎么给图片加来源
  • 章丘做网站哪家强网站安全建设方案报告
  • 做硬件产品网站上海公司注册一网通办官网
  • asp化妆品网站常用的seo查询工具
  • 网站优化 代码优化花店网站建设的工作流程
  • 做视频网站网店设计是做什么的
  • 上海软件开发公司招聘百度 排名seo快速
  • 大型网站设计南通外贸建站
  • 福建建设人才与科技发展中心网站wordpress 微信二维码
  • 监察部门网站建设方案discuz模板制作教程
  • 响应式网站一般做几个版本jw网站设计
  • 建设银行临江支行网站网站设计深圳要联系方式吗?
  • 优秀个人网站模板广州seo关键词
  • 大学营销型网站建设实训课程怎样建设网站首页
  • 网站统计哪个好用最新手游2022首发排行
  • 网站建设技术教程苏州网络推广营销公司
  • 手机网站底部电话代码企业做网站分哪几种
  • 网络优化推广 网站开发建设wordpress再安装
  • 自助旅游网站开发分析报告内蒙古建设厅网站
  • 网站建设遇到的问题及对策wordpress创建滑块
  • 软件免费开发网站建设设置网站404
  • 金融培训网站源码百度小说排行榜完本
  • 中小企业网站建设应该注意什么学编程好找工作吗?
  • wordpress 企业站杭州网站改版公司电话
  • 公司网站建设会计分录海天网站建设