2025-02-14
深度学习
00

我的另一盘类似的教程:https://www.dong-blog.fun/post/1942

2025-02-14
Python
00

以下是一个简单的FastAPI应用程序示例,包含你提到的测试端口代码:

首先,确保你已经安装了 FastAPI 和 Uvicorn。如果还没有安装,可以使用 pip 进行安装:

bash
pip install fastapi uvicorn requests
2025-02-14
Linux运维
00

我们可以按照你的要求配置 Nginx 将客户端的请求头信息及其他设置信息保持和转发。以下是详细的步骤:

  1. 创建 Nginx 配置文件:

    首先需要创建一个 Nginx 配置文件,比如 nginx.conf

    nginx
    events {} http { upstream backend { server 101.136.8.66:7890; } server { listen 7860; location / { proxy_pass http://backend; # 保持客户端的请求头信息 proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; # HTTP 版本和连接管理 proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; # 超时设置 proxy_connect_timeout 300s; proxy_read_timeout 300s; } } }
2025-02-14
深度学习
00

模型:https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B

下载模型,这样下载太慢,换个源头:

bash
# Make sure you have git-lfs installed (https://git-lfs.com) git lfs install git clone https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B # If you want to clone without large files - just their pointers GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B
2025-02-14
算法刷题
00

BFS解题模板(队列版)

python
from collections import deque def bfs(起始点): # 初始化队列和访问标记 queue = deque() queue.append(起始点) visited = set() visited.add(起始点) while queue: # 弹出当前节点 node = queue.popleft() # 处理当前节点(例如记录路径、判断条件等) 处理当前节点 # 遍历相邻节点 for neighbor in 获取相邻节点(node): if neighbor 未越界 and neighbor 未访问: queue.append(neighbor) visited.add(neighbor) # 必须在此处标记已访问