Termux on Android running R1 model

Termux on Android running R1 model

Termux on Android running R1 model

本指南提供兩部分說明:
This guide contains two sections:

部分一:Termux 及 Debian 環境設置 (Steps 1-4)

  1. 安裝 Termux、Termux:Widget 與 Termux:API
    Install Termux, Termux:Widget, and Termux:API from F-Droid.

    從 F-Droid 安裝這些應用。

  2. 打開 Termux 並執行初始設置命令 / Open Termux and Run the Initial Setup Commands
    termux-setup-storage
    termux-wake-lock
    termux-change-repo
    pkg install tur-repo
    pkg update && pkg upgrade 
    pkg install git proot-distro vim termux-api
  3. 使用 proot-distro 安裝並設置 Debian / Install and Set Up Debian using proot-distro
    disname='debian'
    user='brian'
    echo "proot-distro login $disname"  > .shortcuts/debianai.sh
    echo "proot-distro login debian --user $user" > .shortcuts/debian.sh
    proot-distro install debian
    proot-distro login debian
  4. 登錄 Debian 後設置環境 / Set Up the Environment After Logging into Debian
    user='brian'
    apt update && apt upgrade
    apt install sudo locales
    echo "LANG=zh_CN.UTF-8" >> /etc/locale.conf
    sudo locale-gen
    adduser $user
    gpasswd -a $user sudo
    echo "$user   ALL=(ALL:ALL) ALL" >> /etc/sudoers
    login $user

部分二:Ollama 安裝與 DeepSeek-R1 模型執行 (Ollama Installation and Running DeepSeek-R1 Model)

  1. 下載並執行 Ollama 的安裝腳本 / Download and Execute the Ollama Installation Script

    这个命令下载并执行 Ollama 的安装脚本。
    This command downloads and executes the Ollama installation script.

    curl -fsSL https://ollama.com/install.sh | sh
  2. 啟動 Ollama 服務 / Start the Ollama Server

    启动 Ollama 服务。
    Start the Ollama server.

    ollama serve
  3. 運行指定的 DeepSeek-R1 模型 / Run the Specified DeepSeek-R1 Model

    运行指定的 DeepSeek-R1 模型。
    Run the specified DeepSeek-R1 model.

    ollama run deepseek-r1:7b-qwen-distill-q4_K_M

设备性能 / Device Performance:
在手机上运行这些模型可能会对性能有较大的影响,特别是内存占用方面。
In mobile devices, running these models might significantly impact performance, especially in terms of memory usage.

网络连接 / Internet Connection:
确保您有稳定的网络连接,因为可能需要从远程下载模型文件或更新。
Ensure you have a stable internet connection as models might need to be downloaded or updated from remote servers.

存储空间 / Storage Space:
模型文件可能很大,确保设备有足够的存储空间。
Model files can be large, so make sure your device has enough storage space.

安全性 / Security:
执行从网络下载的脚本时,请确保您信任该来源,因为这涉及到在您的设备上执行代码。
When executing scripts downloaded from the internet, ensure you trust the source since this involves running code on your device.

留言

此網誌的熱門文章

Ember's Whisper: A Journey of Fiery Hearts