有時下載大模型總是下載不出來,要配置代理才行
一、Windows代理設置
① 系統全局代理設置
-
打開【設置】→【網絡和Internet】→【代理】。
-
在【手動設置代理】下,打開開關,輸入:
地址:10.10.10.215 端口:7897
-
點擊【保存】。
② 命令行 (cmd/PowerShell) 代理設置
-
設置臨時代理(本窗口有效):
set http_proxy=http://10.10.10.215:7897
set https_proxy=http://10.10.10.215:7897
-
若需要永久設置環境變量:
打開【控制面板】→【系統】→【高級系統設置】→【環境變量】,添加系統變量:
變量名:http_proxy
變量值:http://10.10.10.215:7897 變量名:https_proxy
變量值:http://10.10.10.215:7897
③ Git全局代理設置
git config --global http.proxy http://10.10.10.215:7897
git config --global https.proxy http://10.10.10.215:7897
二、Ubuntu代理設置
① 系統全局代理設置(圖形界面)
打開【設置】→【網絡】→【網絡代理】選擇【手動】,填入:
HTTP Proxy:10.10.10.215 端口:7897
HTTPS Proxy:10.10.10.215 端口:7897
② 終端命令行臨時代理(僅當前終端有效):
export http_proxy=http://10.10.10.215:7897
export https_proxy=http://10.10.10.215:7897
③ 終端永久代理設置(適用于所有終端)
打開終端,編輯~/.bashrc
文件:
nano ~/.bashrc
在文件底部加入:
export http_proxy="http://10.10.10.215:7897"
export https_proxy="http://10.10.10.215:7897"
保存并退出,執行:
source ~/.bashrc
④ apt軟件安裝代理
臨時代理(單次安裝):
sudo apt -o Acquire::http::proxy="http://10.10.10.215:7897/" update
sudo apt -o Acquire::http::proxy="http://10.10.10.215:7897/" install package-name
永久代理(修改/etc/apt/apt.conf
):
sudo nano /etc/apt/apt.conf
加入以下內容并保存:
Acquire::http::proxy "http://10.10.10.215:7897/";
Acquire::https::proxy "http://10.10.10.215:7897/";
⑤ Git全局代理設置(Ubuntu):
git config --global http.proxy http://10.10.10.215:7897
git config --global https.proxy http://10.10.10.215:7897
? 以上方法可快速有效地為 Windows 和 Ubuntu 設置代理服務器為 10.10.10.215:7897
。