<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://chenylvia.github.io//feed.xml" rel="self" type="application/atom+xml" /><link href="https://chenylvia.github.io//" rel="alternate" type="text/html" /><updated>2025-12-28T09:22:06+00:00</updated><id>https://chenylvia.github.io//feed.xml</id><title type="html">Chenyl</title><subtitle>Minimal Jekyll theme for storytellers</subtitle><author><name>Chenyl</name><email>yulin.chen.sc@gmail.com</email></author><entry><title type="html">自贡恐龙主题画展</title><link href="https://chenylvia.github.io//2025-12-21/%E8%87%AA%E8%B4%A1%E6%81%90%E9%BE%99%E4%B8%BB%E9%A2%98%E7%94%BB%E5%B1%95" rel="alternate" type="text/html" title="自贡恐龙主题画展" /><published>2025-12-21T00:00:00+00:00</published><updated>2025-12-21T00:00:00+00:00</updated><id>https://chenylvia.github.io//2025-12-21/%E8%87%AA%E8%B4%A1%E6%81%90%E9%BE%99%E4%B8%BB%E9%A2%98%E7%94%BB%E5%B1%95</id><content type="html" xml:base="https://chenylvia.github.io//2025-12-21/%E8%87%AA%E8%B4%A1%E6%81%90%E9%BE%99%E4%B8%BB%E9%A2%98%E7%94%BB%E5%B1%95"><![CDATA[<p>12月，自贡举办了”一眼一亿年”恐龙主题美术与设计大赛，Na的一张画作入选了此次比赛的终评。于是周末我们前往自贡，观看该比赛的画展。画展地点在四川轻化工大学李白河校区美术馆，展出作品总共有220件，下面是一些印象深刻的作品。<!--more--></p>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/云栖龙隐.jpeg" alt="云栖龙隐" style="zoom: 25%;" /></p>

<center>云栖龙隐</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/沉默的见证者.jpeg" style="zoom:25%;" /></p>

<center>沉默的见证者</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/哥斯拉.jpeg" alt="哥斯拉" style="zoom:25%;" /></p>

<center>哥斯拉</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/迹.jpeg" alt="迹" style="zoom:25%;" /></p>

<center>迹</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/竞游.jpeg" alt="竞游" style="zoom:25%;" /></p>

<center>竞游</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/恐龙之都.jpeg" style="zoom:25%;" /></p>

<center>恐龙之都</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/龙·猫.jpeg" style="zoom:25%;" /></p>

<center>龙·猫</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/龙骸前的光与影.jpeg" style="zoom:25%;" /></p>

<center>龙骸前的光与影</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/青骨穹痕.jpeg" style="zoom:25%;" /></p>

<center>青骨穹痕</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/时空·对话.jpeg" style="zoom:25%;" /></p>

<center>时空·对话</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/探密自贡恐龙纪.jpeg" style="zoom:25%;" /></p>

<center>探密自贡恐龙纪</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/天青石纪.jpeg" style="zoom:25%;" /></p>

<center>天青石纪</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/童趣积木：恐龙绿境.jpeg" style="zoom:25%;" /></p>

<center>童趣积木：恐龙绿境</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/箱中记忆-棘龙和我.jpeg" style="zoom:25%;" /></p>

<center>箱中记忆-棘龙和我</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/墟海生歌.jpeg" style="zoom:25%;" /></p>

<center>墟海生歌</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/远古的遨游.jpeg" style="zoom:25%;" /></p>

<center>远古的遨游</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/远古的回响.jpeg" style="zoom:25%;" /></p>

<center>远古的回响</center>

<p><img src="../assets/img/2025-12-21-自贡恐龙主题画展/长眠.jpeg" style="zoom:25%;" /></p>

<center>长眠</center>]]></content><author><name>chenylvia</name></author><category term="Spark" /><summary type="html"><![CDATA[12月，自贡举办了”一眼一亿年”恐龙主题美术与设计大赛，Na的一张画作入选了此次比赛的终评。于是周末我们前往自贡，观看该比赛的画展。画展地点在四川轻化工大学李白河校区美术馆，展出作品总共有220件，下面是一些印象深刻的作品。]]></summary></entry><entry><title type="html">Spark简介</title><link href="https://chenylvia.github.io//2025-12-07/Spark%E7%AE%80%E4%BB%8B" rel="alternate" type="text/html" title="Spark简介" /><published>2025-12-07T00:00:00+00:00</published><updated>2025-12-07T00:00:00+00:00</updated><id>https://chenylvia.github.io//2025-12-07/Spark%E7%AE%80%E4%BB%8B</id><content type="html" xml:base="https://chenylvia.github.io//2025-12-07/Spark%E7%AE%80%E4%BB%8B"><![CDATA[<p>Spark是一个开源的分布式计算框架，起源于加州大学伯克利分校的AMPLab，在2013年捐赠给Apache软件基金会，目前是Apache顶级项目之一 。Spark提供了一个统一的数据处理引擎，能够在集群上执行批处理作业、交互式查询、流处理、机器学习等多种计算任务。</p>

<p>与Hadoop的MapReduce计算框架相比，Spark通过内存计算技术大大减少了磁盘I/O操作，将中间结果存储在内存中，从而实现了数量级的性能提升。同时，Spark提供了ANSI SQL查询和机器学习能力，常用于大规模数据的批处理和流处理。<!--more--></p>

<h2 id="一spark特点">一、Spark特点</h2>

<h3 id="高性能">高性能</h3>

<p>通过将数据存储在内存中进行计算，Spark能够比基于磁盘的MapReduce快100倍左右。另一方面，Spark的DAG执行引擎能够优化整个数据处理流水线，避免不必要的中间结果写入磁盘的操作。</p>

<h3 id="易用性">易用性</h3>

<p>Spark提供了简洁而强大的API，支持多种编程语言。其核心API包括Spark Core、Spark SQL、Spark Streaming、MLlib和GraphX等组件，为不同的数据处理需求提供了专门的解决方案。开发者可以使用Scala、Java、Python或R语言编写Spark应用程序。</p>

<h3 id="容错性">容错性</h3>

<p>当某个节点出现故障时，Spark能够通过血统机制（lineage）重新计算丢失的数据分区，而不需要像传统系统那样复制整个数据集。这种设计既保证了数据的安全性，又提高了存储效率。</p>

<h3 id="统一平台">统一平台</h3>

<p>Spark提供了一个统一的计算平台，能够处理批处理、流处理、交互式查询、机器学习等多种不同类型的数据处理任务。这种统一性使得开发者可以在同一个框架下处理不同的数据处理需求，大大简化了系统架构。</p>

<h3 id="可扩展性">可扩展性</h3>

<p>Spark设计具有良好的可扩展性，能够在从单机到数千台机器的集群环境中运行。它支持多种集群管理器，包括Spark自带standalone模式、Apache Mesos、Hadoop YARN等。</p>

<h2 id="二整体架构">二、整体架构</h2>

<p>Spark采用了主从（Master-Slave）的分布式架构，主要由以下组件构成：</p>

<p><img src="../assets/img/2025-12-07-Spark简介/spark_architecture.png" alt="Spark核心架构图" /></p>

<h3 id="集群管理器cluster-manager">集群管理器（Cluster Manager）</h3>

<p>集群管理器负责集群资源的分配和管理。Spark支持多种集群管理器：</p>

<ul>
  <li><strong>Standalone模式</strong>：Spark自带的简单集群管理器</li>
  <li><strong>Apache Mesos</strong>：通用的集群资源管理器</li>
  <li><strong>Hadoop YARN</strong>：Hadoop生态系统中的资源管理器</li>
  <li><strong>Kubernetes</strong>：容器编排平台</li>
</ul>

<h3 id="驱动程序driver-program">驱动程序（Driver Program）</h3>

<p>驱动程序是Spark应用程序的入口点，负责创建SparkContext并协调整个Spark作业的执行。它分析应用程序，将其转换为DAG（有向无环图），并将任务分发给执行器。</p>

<h3 id="执行器executor">执行器（Executor）</h3>

<p>执行器是运行在集群工作节点上的进程，负责执行具体的计算任务。每个执行器管理自己的JVM进程和内存空间，可以并行处理多个任务。</p>

<h3 id="rdd弹性分布式数据集">RDD（弹性分布式数据集）</h3>

<p>RDD是Spark的核心数据抽象，代表一个不可变、分区的数据集合。它提供了强大的转换和操作能力，同时具有自动容错和负载均衡的特性。在RDD的基础上，Spark提供了更高层次的数据抽象：</p>

<ul>
  <li><strong>DataFrame</strong>：类似表格的结构化数据，类似于关系型数据库中的表</li>
  <li><strong>Dataset</strong>：强类型的数据集合，提供了类型安全和编译时检查</li>
</ul>

<h2 id="三执行原理">三、执行原理</h2>

<h3 id="dag执行引擎">DAG执行引擎</h3>

<p>当用户提交一个Spark应用程序时，驱动程序会将用户的操作转换为DAG。每个节点代表一个RDD操作，边表示RDD之间的依赖关系。Spark根据DAG的拓扑结构，将任务划分为不同的阶段（stage）。</p>

<p><img src="../assets/img/2025-12-07-Spark简介/spark_dag.jpg" alt="Spark DAG执行引擎原理图" /></p>

<h3 id="阶段划分">阶段划分</h3>

<p>Spark根据shuffle操作将DAG划分为不同的阶段。每个阶段内部的任务可以并行执行，而不同阶段之间需要通过shuffle进行数据交换。这种设计使得Spark能够优化任务的执行顺序，减少磁盘I/O操作。</p>

<h3 id="内存计算">内存计算</h3>

<p>Spark的核心优势在于其内存计算能力。当RDD被创建时，其分区数据会被加载到执行器的内存中。后续的转换操作直接在内存中进行，大大减少了磁盘I/O。Spark使用了统一内存管理机制，在执行内存和存储内存之间进行动态分配。</p>

<p><img src="../assets/img/2025-12-07-Spark简介/spark_memory.png" alt="Spark执行流程与内存计算图" /></p>

<h3 id="容错机制">容错机制</h3>

<p>Spark通过血统机制（lineage）实现容错。当某个RDD分区丢失时，Spark可以根据原始RDD和一系列转换操作重新计算该分区，而不需要复制整个数据集。这种方法既节省了存储空间，又保证了数据的完整性。</p>

<h3 id="懒评估lazy-evaluation">懒评估（Lazy Evaluation）</h3>

<p>Spark采用了懒评估的策略，只有当遇到行动操作（action operation）时才会真正开始执行计算。这种设计使得Spark能够优化整个执行计划，避免不必要的中间计算。</p>

<h2 id="四总结">四、总结</h2>

<p>作为分布式计算框架，Spark在大数据处理领域具有重要的地位。它通过内存计算、DAG执行引擎和统一的数据处理API，成功地解决了传统MapReduce在性能和易用性方面的不足。随着大数据技术的不断发展，Spark持续演进，添加了更多新特性和优化。其生态系统不断壮大，从基础的Spark Core扩展到了Spark SQL、Spark Streaming、MLlib、GraphX等专门的应用领域。Spark的成功不仅推动了分布式计算技术的发展，也为现代数据科学和机器学习应用提供了强大的基础设施支持。在未来，Spark将继续在提升性能、增强易用性和扩展应用场景方面发挥重要作用，为大数据处理和实时分析提供更加高效和便捷的解决方案 。</p>]]></content><author><name>chenylvia</name></author><category term="Spark" /><summary type="html"><![CDATA[Spark是一个开源的分布式计算框架，起源于加州大学伯克利分校的AMPLab，在2013年捐赠给Apache软件基金会，目前是Apache顶级项目之一 。Spark提供了一个统一的数据处理引擎，能够在集群上执行批处理作业、交互式查询、流处理、机器学习等多种计算任务。 与Hadoop的MapReduce计算框架相比，Spark通过内存计算技术大大减少了磁盘I/O操作，将中间结果存储在内存中，从而实现了数量级的性能提升。同时，Spark提供了ANSI SQL查询和机器学习能力，常用于大规模数据的批处理和流处理。]]></summary></entry><entry><title type="html">一些开源工具</title><link href="https://chenylvia.github.io//2025-12-01/%E4%B8%80%E4%BA%9B%E5%BC%80%E6%BA%90%E5%B7%A5%E5%85%B7" rel="alternate" type="text/html" title="一些开源工具" /><published>2025-12-01T00:00:00+00:00</published><updated>2025-12-01T00:00:00+00:00</updated><id>https://chenylvia.github.io//2025-12-01/%E4%B8%80%E4%BA%9B%E5%BC%80%E6%BA%90%E5%B7%A5%E5%85%B7</id><content type="html" xml:base="https://chenylvia.github.io//2025-12-01/%E4%B8%80%E4%BA%9B%E5%BC%80%E6%BA%90%E5%B7%A5%E5%85%B7"><![CDATA[<p>本文记录一些开源工具。<!--more--></p>

<h2 id="作图">作图</h2>

<p><a href="https://github.com/DayuanJiang/next-ai-draw-io">next-ai-draw-io</a></p>

<p>一个AI增强版draw.io作图网页应用，允许通过自然语言来作图。</p>]]></content><author><name>chenylvia</name></author><category term="工具" /><summary type="html"><![CDATA[本文记录一些开源工具。]]></summary></entry><entry><title type="html">理解大模型中的温度参数</title><link href="https://chenylvia.github.io//2025-07-13/%E7%90%86%E8%A7%A3%E5%A4%A7%E6%A8%A1%E5%9E%8B%E4%B8%AD%E7%9A%84%E6%B8%A9%E5%BA%A6%E5%8F%82%E6%95%B0" rel="alternate" type="text/html" title="理解大模型中的温度参数" /><published>2025-07-13T00:00:00+00:00</published><updated>2025-07-13T00:00:00+00:00</updated><id>https://chenylvia.github.io//2025-07-13/%E7%90%86%E8%A7%A3%E5%A4%A7%E6%A8%A1%E5%9E%8B%E4%B8%AD%E7%9A%84%E6%B8%A9%E5%BA%A6%E5%8F%82%E6%95%B0</id><content type="html" xml:base="https://chenylvia.github.io//2025-07-13/%E7%90%86%E8%A7%A3%E5%A4%A7%E6%A8%A1%E5%9E%8B%E4%B8%AD%E7%9A%84%E6%B8%A9%E5%BA%A6%E5%8F%82%E6%95%B0"><![CDATA[<p>在使用大模型或调用大模型接口时，通常有一个温度参数需要配置，刚使用时可能并不清楚如何设置这一参数值，以及该值对大模型输出结果的影响。本文讲解温度参数的基本原理和常规使用，来帮助大家理解温度参数。<!--more--></p>

<h2 id="一温度参数是什么">一、温度参数是什么</h2>

<p>温度参数是大模型使用中的一个常见配置。例如xxx模块，有个配置temperature，它就是温度参数。平台对它的解释是：</p>

<blockquote>
  <p>要使用的采样温度（temperature），介于 0 和 2 之间。较高的值（如 0.8）会使输出更随机，而较低的值（如 0.2）则会使其更加专注和确定。我们通常建议只修改此参数或 top_p 一个参数而不是两个同时修改，默认为1.0, 0表示贪婪采样。</p>
</blockquote>

<p><img src="" alt="image-20250630190355774" /></p>

<p>使用xxxSDk时，也会设置温度值：</p>

<p><img src="" alt="image-20250630190815645" /></p>

<p>在大模型中，温度参数（temperature）用来控制输出结果的确定性。该参数值是一个大于0的数值，通常取值范围在0到2之间。当值较低时，对应输出结果确定性较高。反之输出结果确定性较低，随机性较高。</p>

<h2 id="二温度参数对大模型输出的影响">二、温度参数对大模型输出的影响</h2>

<p>在理解温度参数的基本原理之前，先理解原始分数和Softmax函数。</p>

<ul>
  <li>
    <p>原始分数</p>

    <p>当大模型准备生成一个词时，它会为词汇表中的每一个可能的词计算一个原始分数，也可称为置信度。原始分数表示模型生成每个词的可能性，它们可以是任何实数（正数、负数或零）。原始分数值越大，模型认为这个词越可能出现。</p>
  </li>
  <li>
    <p>Softmax函数：</p>

    <p>Softmax函数又称为归一化指数函数，用于将原始分数转换为可以理解的概率分布（所有词的概率之和为1），该函数用数学表达式可表示为：
\(P_i = e^{z_i} / \sum_j e^{z_j}\)
其中$P_i$表示概率，$z_i$表示模型输出的原始分数。</p>
  </li>
</ul>

<p>假设模型在生成下一个词时，原始分数的概率分布通过Softmax函数计算。通过温度参数来调整原始分数$z_i$的概率分布，数学表达式如下：
\(P_i(T) = e^{z_i / T} / \sum_j e^{z_j / T}\)
从上述数学表达式可看出，当温度值T小于1时，由于原始分数除以一个小于1的数，它的值会被放大，这意味着原始分数之间的差异会增大。经过Softmax函数处理后，高概率词的概率会进一步上升，低概率的词的概率会进一步下降。结果使得概率分布变得尖锐，模型会更强烈地选择偏向于原始分数最高的词，这使得输出结果更加确定。T等于1时，原始概率分布保持不变，</p>

<p>温度值T等于1，保持原始分数的概率分布不变，相当于直接使用模型输出的原始分数进行采样，输出较为平衡。</p>

<p>当温度值T大于1，会缩小原始分数之间的差异。经过Softmax函数后后，高概率词生成的概率会下降，低概率词生成的概率会上升。结果是概率分布变更平台，模型在生成下一个词时，会倾向于从更多不同的词中随机选择，增加了输出结果的随机性和多样性，但可能降低逻辑性。</p>

<h2 id="三总结">三、总结</h2>

<p>在配置温度参数的过程中，如果配置较高的数值，会使大模型输出结果更加随机，配置较低的数值则输出结果更加确定。不同的温度值范围有不同的应用场景，例如在低温值（0-0.5）情况下，模型输出的确定性较高，常用于代码生成等对输出一致性要求高的场景。高温值（ &gt; 1）则常用于对创造性要求高的场景，例如文学创作、头脑风暴的场景中。在使用过程中因结合实际需求场景来设置温度值，同时根据模型输出的结果来进行调整，达到良好的输出效果。</p>

<table>
  <thead>
    <tr>
      <th>温度值范围</th>
      <th>输出效果</th>
      <th>应用场景</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>低温（0 - 0.5）</td>
      <td>输出确定性高</td>
      <td>代码生成、法律文本</td>
    </tr>
    <tr>
      <td>中温（0.5 - 1）</td>
      <td>输出确定性和随机性较为平衡</td>
      <td>对话系统、常规文本</td>
    </tr>
    <tr>
      <td>高温（ &gt; 1）</td>
      <td>输出随机性高，更具创造力，但可能导致逻辑混乱</td>
      <td>文学创作、头脑风暴</td>
    </tr>
  </tbody>
</table>]]></content><author><name>chenylvia</name></author><category term="其他" /><summary type="html"><![CDATA[在使用大模型或调用大模型接口时，通常有一个温度参数需要配置，刚使用时可能并不清楚如何设置这一参数值，以及该值对大模型输出结果的影响。本文讲解温度参数的基本原理和常规使用，来帮助大家理解温度参数。]]></summary></entry><entry><title type="html">Ollama使用教程</title><link href="https://chenylvia.github.io//2025-06-22/Ollama%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B" rel="alternate" type="text/html" title="Ollama使用教程" /><published>2025-06-22T00:00:00+00:00</published><updated>2025-06-22T00:00:00+00:00</updated><id>https://chenylvia.github.io//2025-06-22/Ollama%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B</id><content type="html" xml:base="https://chenylvia.github.io//2025-06-22/Ollama%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B"><![CDATA[<p>Ollama是一个开源工具，用于本地运行大模型，它的特点是使用简单，配置方便。本文介绍如何使用Ollama。<!--more--></p>

<h2 id="一安装ollama">一、安装Ollama</h2>

<ul>
  <li>Windows / MacOS</li>
</ul>

<p>访问<a href="https://ollama.com/">Ollama官方网站</a>下载安装包。</p>

<ul>
  <li>MacOS</li>
</ul>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>brew <span class="nb">install </span>ollama
</code></pre></div></div>

<ul>
  <li>Linux</li>
</ul>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>curl <span class="nt">-fsSL</span> https://ollama.com/install.sh | sh
</code></pre></div></div>

<ul>
  <li>Docker</li>
</ul>

<p>拉取Docker镜像：</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker pull ollama/ollama
</code></pre></div></div>

<p>安装完成后，执行如下命令查看版本号：</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ollama <span class="nt">-v</span>
</code></pre></div></div>

<p>查看使用说明：</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ollama <span class="nt">-h</span>
</code></pre></div></div>

<p>结果：</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Usage:
  ollama <span class="o">[</span>flags]
  ollama <span class="o">[</span><span class="nb">command</span><span class="o">]</span>

Available Commands:
  serve       Start ollama
  create      Create a model from a Modelfile
  show        Show information <span class="k">for </span>a model
  run         Run a model
  stop        Stop a running model
  pull        Pull a model from a registry
  push        Push a model to a registry
  list        List models
  ps          List running models
  <span class="nb">cp          </span>Copy a model
  <span class="nb">rm          </span>Remove a model
  <span class="nb">help        </span>Help about any <span class="nb">command

</span>Flags:
  <span class="nt">-h</span>, <span class="nt">--help</span>      <span class="nb">help </span><span class="k">for </span>ollama
  <span class="nt">-v</span>, <span class="nt">--version</span>   Show version information

Use <span class="s2">"ollama [command] --help"</span> <span class="k">for </span>more information about a command.
</code></pre></div></div>

<p>Ollama基于客户端-服务端架构，执行<code class="language-plaintext highlighter-rouge">ollama serve</code>开启服务端。</p>

<h2 id="二运行模型">二、运行模型</h2>

<p>Ollama支持多个模型，例如deepseek-r1和qwen3等，可访问<a href="https://ollama.com/search">官网模型入口</a>查看具体模型。</p>

<p><img src="../assets/img/2025-06-22-Ollama使用教程/ollama-models.png" alt="ollama-models" /></p>

<p>点击模型名称，可以看到不同类型的模型：</p>

<p><img src="../assets/img/2025-06-22-Ollama使用教程/deepseek-r1-models.png" alt="deepseek-r1-models" /></p>

<p>下载模型：</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ollama pull &lt;模型名称&gt;
</code></pre></div></div>

<p>查看已下载模型：</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ollama list
</code></pre></div></div>

<p>查看模型信息：</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ollama show &lt;模型名称&gt;
</code></pre></div></div>

<p>运行模型（如果本地没有该模型，则会先进行下载）：</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ollama run &lt;模型名称&gt;
</code></pre></div></div>

<p>以deepseek-r1:1.5b模型为例，本地运行后，出现命令行交互界面，输入问题后模型返回结果：</p>

<p><img src="../assets/img/2025-06-22-Ollama使用教程/ollama-model-cli.png" align="left" alt="ollama-model-cli" style="zoom:50%;" /></p>

<h2 id="三自定义模型">三、自定义模型</h2>

<p>Ollama支持创建自定义模型，并且提供了Modelfile文件来管理模型配置，使用自定义模型的好处是可以根据自己需求进行个性化配置。</p>

<p>通过现有模型创建自定义模型：</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ollama create &lt;自定义模型名称&gt; <span class="nt">-f</span> &lt;Modelfile&gt;
</code></pre></div></div>

<p>Modelfile是模型配置文件，用于定义和管理模型，可以在其中配置模型温度和随机种子等。</p>

<p>将自定义模型推送到模型库：</p>

<div class="language-shell highlighter-rouge"><div class="highlight"><pre class="highlight"><code>ollama push &lt;自定义模型名称&gt;
</code></pre></div></div>

<h2 id="四总结">四、总结</h2>

<p>通过使用Ollama工具，可以很方便地下载和运行模型。Ollama也提供了基于HTTP的API，开发者可通过接口调用的方式和模型进行交互。总之，Ollama类似于软件应用中的Docker，简化了本地配置和部署模型的流程。</p>]]></content><author><name>chenylvia</name></author><category term="大模型" /><summary type="html"><![CDATA[Ollama是一个开源工具，用于本地运行大模型，它的特点是使用简单，配置方便。本文介绍如何使用Ollama。]]></summary></entry><entry><title type="html">SCQA模型是什么</title><link href="https://chenylvia.github.io//2024-03-17/what-is-scqa" rel="alternate" type="text/html" title="SCQA模型是什么" /><published>2024-03-17T00:00:00+00:00</published><updated>2024-03-17T00:00:00+00:00</updated><id>https://chenylvia.github.io//2024-03-17/what-is-scqa</id><content type="html" xml:base="https://chenylvia.github.io//2024-03-17/what-is-scqa"><![CDATA[<p>万事开头难，写文章也不例外。<!--more--></p>

<p>很多时候我们迟迟无法下笔，认为文章的序言既不能过于简单而苍白无力，又不能掺杂太多其它信息，导致主题分散。</p>

<p>如何快速构思好文章的序言，并且把主题表达清楚？</p>

<p>我们需要一种结构化表达方法，通过某种结构来组织内容，使其具有逻辑性。</p>

<p>SCQA模型就是这样一种结构化表达方法，来源于麦肯锡咨询顾问芭芭拉·明托（Barbara Minto）的著作《金字塔原理》，通常用于文章的序言或演讲的开场白。其中S，C，Q，A分别是英文单词Situation（背景）， Complication（冲突），Q：Question（问题），A：Answer（答案）的缩写。简单来说，这是一种“背景，冲突，问题，答案”的内容结构，首先介绍背景，然后说明发生的冲突，进而引出问题，最后针对该问题给出答案。</p>

<p>使用“背景，冲突，问题，答案”的结构，其中各部分的顺序可以灵活变化。例如，可以开门见山式的给出答案，再介绍背景和冲突。也可以先抛出问题，在后续采用背景，冲突，答案的结构。</p>

<p>使用SCQA模型来组织序言，有以下两个好处：</p>

<p>第一个好处是，通过背景、冲突、问题、答案四个部分，层层推进，逻辑清晰，符合一般的思维习惯。</p>

<p>第二个好处是，对于作者，掌握了这种方法后，有助于快速构思出内容结构。对于读者，更容易被内容所吸引，并产生共鸣。</p>

<p>基于上述优点，SCQA模型的应用非常广泛，在很多演讲、电影和广告中，都能看到这种表达方法的应用。本篇文章的开头就使用了SCQA模型来组织语言，也是一种简单的应用。推荐大家使用这一方法，来提高表达内容的逻辑性。</p>]]></content><author><name>chenylvia</name></author><category term="其他" /><summary type="html"><![CDATA[万事开头难，写文章也不例外。]]></summary></entry><entry><title type="html">Introducing Tale</title><link href="https://chenylvia.github.io//2017-03-29/introducing-tale" rel="alternate" type="text/html" title="Introducing Tale" /><published>2017-03-29T00:00:00+00:00</published><updated>2017-03-29T00:00:00+00:00</updated><id>https://chenylvia.github.io//2017-03-29/introducing-tale</id><content type="html" xml:base="https://chenylvia.github.io//2017-03-29/introducing-tale"><![CDATA[<p>Tale is a minimal <a href="https://jekyllrb.com/">Jekyll</a> theme curated for storytellers. It is designed and developed by <a href="https://github.com/chesterhow/">myself</a> for a friend who writes short stories.<!--more--></p>

<h2 id="tale-features">Tale features</h2>

<ul>
  <li>Compatible with GitHub Pages</li>
  <li>Responsive design (looks just as good on mobile)</li>
  <li>Syntax highlighting, with the help of Pygments</li>
  <li>Markdown and HTML text formatting</li>
  <li>Pagination of posts</li>
  <li>Sticky posts</li>
  <li>Tags</li>
  <li>Excerpt management</li>
  <li>Disqus comments</li>
</ul>

<p>Head over to the <a href="/2017-03-16/example-content">Example Content</a> post for a showcase of Tale’s text formatting features.</p>

<h2 id="browser-support">Browser Support</h2>

<p>Tale works on most if not all modern browsers, including Chrome, Safari and Firefox 👍🏼</p>

<h2 id="download-or-contribute">Download or Contribute</h2>

<p>Tale is publicly hosted on GitHub, so go ahead and download or fork it at the <a href="https://github.com/chesterhow/tale">GitHub repository</a>. If you spot any bugs or have any suggestions, feel free to create an issue or make a pull request.</p>

<p>Thanks for checking out Tale!</p>

<p>风景</p>

<p><img src="../assets/images/WechatIMG2.jpeg" alt="" /></p>]]></content><author><name>Chester</name></author><category term="其他" /><summary type="html"><![CDATA[Tale is a minimal Jekyll theme curated for storytellers. It is designed and developed by myself for a friend who writes short stories.]]></summary></entry></feed>