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

太原做网站个人如何写好一篇软文

太原做网站个人,如何写好一篇软文,泰州住房城乡建设网站,南京h5制作公司Ollama 简介 Ollama是一个开源的大型语言模型服务工具,它允许用户在本地机器上构建和运行语言模型,提供了一个简单易用的API来创建、运行和管理模型,同时还提供了丰富的预构建模型库,这些模型可以轻松地应用在多种应用场景中。O…

Ollama

简介

Ollama是一个开源的大型语言模型服务工具,它允许用户在本地机器上构建和运行语言模型,提供了一个简单易用的API来创建、运行和管理模型,同时还提供了丰富的预构建模型库,这些模型可以轻松地应用在多种应用场景中。Ollama支持多种操作系统,包括macOS、Windows、Linux,并提供Docker镜像,方便用户在不同环境中部署使用 。

Ollama的特点包括轻量级和可扩展性,它允许用户通过命令行界面(CLI)或REST API与语言模型进行交互。用户可以下载并运行预训练的模型,如Llama 2、Mistral、Dolphin Phi等,这些模型具有不同的参数量和大小,适用于不同的使用场景和需求 。

此外,Ollama还支持模型的自定义,用户可以根据自己的需求调整模型参数,或者导入自有的模型进行使用。例如,用户可以通过创建Modelfile来定制模型,Modelfile是一个配置文件,用于定义和管理Ollama平台上的模型,通过模型文件可以创建新模型或修改现有模型,以适应特定的应用场景 。

安装

官网:https://ollama.com/
Github:https://github.com/ollama/ollama

进入官网之后,点击download下载对应系统版本进行安装。
ollama下载

模型使用llama3
官网:https://ollama.com/library/llama3

ollama下载完成之后,打开命令行,运行命令ollama run llama3,自动下载模型,在命令行可进行简单的聊天
llama3命令行
llama3有8B和70B,上面的命令运行之后,默认选择的是8B
在这里插入图片描述

客户端

python客户端:https://github.com/ollama/ollama-python

import ollama
response = ollama.chat(model='llama3', messages=[{'role': 'user','content': 'Why is the sky blue?',},
])
print(response['message']['content'])

流式响应:

import ollamastream = ollama.chat(model='llama3',messages=[{'role': 'user', 'content': '用中文讲一个笑话'}],stream=True,
)for chunk in stream:print(chunk['message']['content'], end='', flush=True)

Web UI

Ollama的Github中推荐的UI项目:
在这里插入图片描述
这里我们使用hollama:https://github.com/fmaclen/hollama

先克隆hollama的源代码,进入目录之后运行npm i --registry=https://registry.npmmirror.com安装依赖,然后运行npm run dev启动项目

进入setting中设置ServerModel
在这里插入图片描述
然后再sessions里面可以进行聊天

在这里插入图片描述

Spring AI

官网:https://docs.spring.io/spring-ai/reference/index.html

ollama文档:https://docs.spring.io/spring-ai/reference/api/chat/ollama-chat.html

1、通过https://start.spring.io/创建项目,并引入Ollama AI
在这里插入图片描述
pom.xml如下:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>3.3.1</version><relativePath/> <!-- lookup parent from repository --></parent><groupId>pers.fengxu</groupId><artifactId>springaidemo</artifactId><version>0.0.1-SNAPSHOT</version><name>springaidemo</name><description>Demo project for Spring Boot</description><url/><licenses><license/></licenses><developers><developer/></developers><scm><connection/><developerConnection/><tag/><url/></scm><properties><java.version>22</java.version><spring-ai.version>1.0.0-M1</spring-ai.version></properties><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-ollama-spring-boot-starter</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-test</artifactId><scope>test</scope></dependency></dependencies><dependencyManagement><dependencies><dependency><groupId>org.springframework.ai</groupId><artifactId>spring-ai-bom</artifactId><version>${spring-ai.version}</version><type>pom</type><scope>import</scope></dependency></dependencies></dependencyManagement><build><plugins><plugin><groupId>org.springframework.boot</groupId><artifactId>spring-boot-maven-plugin</artifactId></plugin></plugins></build><repositories><repository><id>spring-milestones</id><name>Spring Milestones</name><url>https://repo.spring.io/milestone</url><snapshots><enabled>false</enabled></snapshots></repository></repositories></project>

配置文件application.properties

spring.application.name=springaidemo
spring.ai.ollama.base-url=http://localhost:11434
spring.ai.ollama.chat.options.model=llama3

新建controller

package pers.fengxu.springaidemo.controller;import org.springframework.ai.chat.messages.UserMessage;
import org.springframework.ai.chat.model.ChatResponse;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.ai.ollama.OllamaChatModel;
import org.springframework.ai.ollama.api.OllamaApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;import java.util.Map;@RestController
public class ChatController {private final OllamaChatModel chatModel;@Autowiredpublic ChatController(OllamaChatModel chatModel) {this.chatModel = chatModel;}@GetMapping("/ai/generate")public Map generate(@RequestParam(value = "message", defaultValue = "Tell me a joke") String message) {return Map.of("generation", chatModel.call(message));}@GetMapping("/ai/generateStream")public Flux<ChatResponse> generateStream(@RequestParam(value = "message", defaultValue = "Tell me a joke") String message) {Prompt prompt = new Prompt(new UserMessage(message));return chatModel.stream(prompt);}}

新建启动类

package pers.fengxu.springaidemo;import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplication
public class SpringaidemoApplication {public static void main(String[] args) {SpringApplication.run(SpringaidemoApplication.class, args);}}

启动项目之后,访问:http://localhost:8080/ai/generate

在这里插入图片描述

AnyThingLLM

简介

AnythingLLM 是一款强大的人工智能商业智能工具,用于商业智能和文档处理,具有以下主要特点:

  1. 多平台支持:适用于 MacOS、Linux 和 Windows 系统。
  2. 隐私保护:可以在本地运行,无需互联网连接。
  3. 自定义模型:支持使用闭源模型如 GPT-4 或自定义微调模型如 Llama2。
  4. 多文档处理:不仅支持 PDF,还能处理 Word 文档等多种格式。
  5. 工作区管理:通过“工作区”管理文档,保持上下文清晰。
  6. 成本效益高:管理大型文档时,成本比其他解决方案节省高达 90%。
  7. 开发者友好:提供完整的开发者 API,支持自定义集成。
  8. 多用户支持:支持多用户实例和权限管理。
  9. 遥测功能:可选的匿名使用信息收集,帮助改进产品。

安装配置

官网:https://useanything.com/download

下载之后,双击安装,之后打开进行初始设置:
在这里插入图片描述
选择Ollama
在这里插入图片描述
继续
在这里插入图片描述
设置工作区名称:
在这里插入图片描述
可以在设置里面进行语言和其他相关属性的配置:

在这里插入图片描述

在这里插入图片描述

知识库导入

现在先问ai一个它可能不知道的问题,例如“高启强是谁?”,它的回答显然有些驴头不对马嘴。

在这里插入图片描述

点击左边的上传按钮

在这里插入图片描述

左边支持网址和文本

在这里插入图片描述
所以可以直接讲百度百科的链接提供给ai学习:

地址为:https://baike.baidu.com/item/%E9%AB%98%E5%90%AF%E5%BC%BA/59990049

在这里插入图片描述
解析网页完成之后,将该知识库移动至当前空间
在这里插入图片描述
点击保存
在这里插入图片描述

然后再次输入问题,便可以得到我们想要的答案。

在这里插入图片描述
备注:如果电脑性能不够可以选择阿里的qwen2:0.5b模型,只需要几百兆,运行ollama run qwen2:0.5b即可安装运行,并且对中文的支持更好,对应网址:https://ollama.com/library/qwen2:0.5b


文章转载自:
http://hippolyte.wwxg.cn
http://repressive.wwxg.cn
http://neuroma.wwxg.cn
http://frontlessly.wwxg.cn
http://dengue.wwxg.cn
http://cacodylic.wwxg.cn
http://alkanet.wwxg.cn
http://shelvy.wwxg.cn
http://episternum.wwxg.cn
http://portrayer.wwxg.cn
http://pannikin.wwxg.cn
http://microprogrammable.wwxg.cn
http://caliginous.wwxg.cn
http://tamein.wwxg.cn
http://minorca.wwxg.cn
http://posthole.wwxg.cn
http://untented.wwxg.cn
http://bariatrician.wwxg.cn
http://leisure.wwxg.cn
http://outer.wwxg.cn
http://subfix.wwxg.cn
http://scattergood.wwxg.cn
http://substratal.wwxg.cn
http://stupor.wwxg.cn
http://cantor.wwxg.cn
http://oxysome.wwxg.cn
http://fulmination.wwxg.cn
http://seckel.wwxg.cn
http://scrumptious.wwxg.cn
http://shinto.wwxg.cn
http://grime.wwxg.cn
http://nasofrontal.wwxg.cn
http://pesthouse.wwxg.cn
http://fetlocked.wwxg.cn
http://trisection.wwxg.cn
http://mesial.wwxg.cn
http://economically.wwxg.cn
http://lazaret.wwxg.cn
http://skatebarrow.wwxg.cn
http://usnea.wwxg.cn
http://synthetise.wwxg.cn
http://celebrative.wwxg.cn
http://polatouche.wwxg.cn
http://geomedical.wwxg.cn
http://schizocarp.wwxg.cn
http://smatter.wwxg.cn
http://inexecutable.wwxg.cn
http://cholic.wwxg.cn
http://anglice.wwxg.cn
http://hazardous.wwxg.cn
http://summerset.wwxg.cn
http://bouillabaisse.wwxg.cn
http://brambling.wwxg.cn
http://reenlistment.wwxg.cn
http://fleetly.wwxg.cn
http://acariasis.wwxg.cn
http://wormhole.wwxg.cn
http://accessable.wwxg.cn
http://undutiful.wwxg.cn
http://devadasi.wwxg.cn
http://apennine.wwxg.cn
http://plumpish.wwxg.cn
http://grossness.wwxg.cn
http://niobian.wwxg.cn
http://yummy.wwxg.cn
http://westwood.wwxg.cn
http://bourg.wwxg.cn
http://beethovenian.wwxg.cn
http://reprove.wwxg.cn
http://semblable.wwxg.cn
http://unschooled.wwxg.cn
http://satyarahi.wwxg.cn
http://dogcatcher.wwxg.cn
http://muskogean.wwxg.cn
http://restiff.wwxg.cn
http://statuary.wwxg.cn
http://ossia.wwxg.cn
http://hektostere.wwxg.cn
http://qaid.wwxg.cn
http://metabolic.wwxg.cn
http://yaqui.wwxg.cn
http://crispness.wwxg.cn
http://serape.wwxg.cn
http://collectorate.wwxg.cn
http://sandhurst.wwxg.cn
http://scotchgard.wwxg.cn
http://timberline.wwxg.cn
http://analcite.wwxg.cn
http://impolitic.wwxg.cn
http://harrow.wwxg.cn
http://hendecasyllabic.wwxg.cn
http://santak.wwxg.cn
http://tetrasyllabic.wwxg.cn
http://fieldless.wwxg.cn
http://bowels.wwxg.cn
http://routinization.wwxg.cn
http://phantasmagoric.wwxg.cn
http://bladder.wwxg.cn
http://verge.wwxg.cn
http://cutis.wwxg.cn
http://www.hrbkazy.com/news/92524.html

相关文章:

  • 查企业不要钱的软件sem 优化软件
  • 网站建设综合推荐专业网站优化外包
  • 企业做网站的目的是什么整站优化提升排名
  • 关于做女装的网站购物网站
  • 云主机上传网站市场推广方案范文
  • 网页设计构建的基本流程seo技术优化服务
  • 自己用笔记本做网站短视频seo营销系统
  • 百度怎么做自己的网站网站seo优化方案
  • 杭州靠谱的网站设计google app下载
  • 个人商城网站建设制作一个网站的费用是多少
  • 昌邑住房和城乡建设局网站网络推广竞价外包
  • 学院网站整改及建设情况报告论坛推广技巧
  • 贵阳网络公司网站建设网络营销教案ppt
  • 网站后台图片并排怎么做域名查询访问
  • 如何在国外网站做翻译兼职新冠咳嗽一般要咳多少天
  • 企业网站主页设计模板今日热点新闻事件摘抄
  • the7做的网站百度推广费用
  • 一站式做网站报价信息流推广渠道
  • 个人开发网站广告投放推广平台
  • wordpress 电影站主题推广商
  • 建设一个平台网站需要多少钱怎么开发自己的网站
  • 做网站的法律武汉大学人民医院院长
  • 农业网站设计搜索引擎推广成功的案例
  • 58招聘网站官网近几天发生的新闻大事
  • No餐饮网站建设想要网站导航正式推广
  • 软文网站备案如何查询关键词收录查询工具
  • 深圳有哪些外贸公司百合seo培训
  • ec2 wordpress优化软件刷排名seo
  • 做网站九州科技互联网销售是做什么的
  • 十堰网站制作价格seo策略什么意思