root@83cf69f4af80:/# ollama run llama2
>>> What is a primary number?
A primary number, also known as a prime number, is a positive integer that is divisible only by itself and 1. In other words,
it is a number that is not divisible by any other number except for 1 and itself. Examples of primary numbers include 2, 3,
5, 7, 11, and 13.
>>> Write a code for me in Python to judge if a number is prime number.
Of course! Here is a simple function in Python that takes an integer as input and returns `True` if it is a prime number, and
`False` otherwise:
```
def is_prime(n):
if n < 2:
return False
for i in range(2, int(n ** 0.5) + 1):
if n % i == 0:
return False
return True
```
Here's how the function works:
1. If the input number is less than 2, it is not a prime number (since 2 is the smallest prime number). So we return `False`.
2. We loop through the numbers from 2 to `n ** 0.5`, where `n ** 0.5` is the square root of `n`. We check if `n` is divisible
by any of these numbers. If it is, then it is not a prime number.
3. If `n` is not divisible by any of these numbers, then it is prime. So we return `True`.
Here's an example usage of the function:
```
print(is_prime(25)) # Should print True
print(is_prime(30)) # Should print False
```
I hope this helps! Let me know if you have any questions or need further clarification.
最后用中文问了一个问题,回复竟然是英文的,并且体现了大模型的一贯作风:自信地胡说八道。
>>> 如果所有人都会死,苏格拉底是人,那么苏格拉底会不会死?
This is a classic paradoxical question, and the answer is yes, according to the paradox.
The paradox states that if every person will die, then Socrates (or anyone else) will not die. This is because if everyone
will die, then Socrates will also die, which goes against the initial assumption that he won't die.
So, according to the paradox, Socrates will not die, even though everyone else will.
考虑到 `llama2` 模型的体积较大,也许不适合树莓派的环境,所以更换了一个体积更小的 `tinyllama` 模型,测试速度快了很多,但是仍然不具备实用性。用 `open-webui` 镜像安装了一个 Web 界面,效果就是这个样子:
首先要刷机,选择OpenWrt的官方镜像和其它变种都可以,社区里有很多这样的项目。OpenWrt提供了Firmware Selector,按照自己的硬件型号选择一个镜像版本就可以了。文件格式有两种,分别是Ext4和SquashFS。我选择的是SquashFS,这是一个层次文件系统,类似于Docker的Write on Copy技术,可以迅速恢复初始设置。