This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def load_usernames(filename): | |
| with open(filename, 'r', encoding='utf-8') as f: | |
| # 去除换行符,并过滤空行 | |
| return set(line.strip() for line in f if line.strip()) | |
| def main(): | |
| a_members = load_usernames('a_members.txt') | |
| b_members = load_usernames('b_members.txt') | |
| common_members = a_members & b_members # 交集操作 |
- 在远程服务器上开启端口转发
sudo vi /etc/ssh/sshd_config
# 添加以下两行
AllowTcpForwarding yes
GatewayPorts yes
# 重启ssh服务
sudo systemctl restart sshd
- 在本地机器上连接远程服务器
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| from setuptools import setup | |
| from Cython.Build import cythonize | |
| import os | |
| # 指定要编译的文件夹 | |
| py_files = [] | |
| for root, dirs, files in os.walk("./"): | |
| if "dist" in root or "venv" in root or "logs" in root or "input" in root or "output" in root or "test_videos" in root: | |
| continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import socket | |
| def get_local_ip(): | |
| """返回本机用于对外通信的 IPv4 地址(不会发实际数据)""" | |
| s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
| try: | |
| # 这里用任意公网地址和端口(不必可达) | |
| s.connect(("8.8.8.8", 80)) | |
| ip = s.getsockname()[0] | |
| except Exception: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| import os | |
| import sys | |
| import argparse | |
| def merge_py_files(file_list, output_file="merged_output.txt"): | |
| """ | |
| 将多个Python文件的内容合并到一个txt文件中 |
[root@ai-03 extract_keywords]# sudo yum install -y gcc gcc-c++ make cmake git wget
Repository libnvidia-container is listed more than once in the configuration
Repository libnvidia-container-experimental is listed more than once in the configuration
nvidia-container-runtime 0.0 B/s | 0 B 00:01
Errors during downloading metadata for repository 'nvidia-container-runtime':
- Curl error (35): SSL connect error for https://nvidia.github.io/nvidia-container-runtime/stable/centos8/aarch64/repodata/repomd.xml [OpenSSL SSL_connect: Connection reset by peer in connection to nvidia.github.io:443 ]
Error: Failed to download metadata for repo 'nvidia-container-runtime': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
解决方法
- 安cifs-utils 但是安装的时候老报以下错误
(venv) [root@ai-03 asr]# sudo dnf install -y cifs-utils
Repository libnvidia-container is listed more than once in the configuration
Repository libnvidia-container-experimental is listed more than once in the configuration
libnvidia-container 0.0 B/s | 0 B 00:01
Errors during downloading metadata for repository 'libnvidia-container':
- Curl error (35): SSL connect error for https://nvidia.github.io/libnvidia-container/stable/centos8/aarch64/repodata/repomd.xml [OpenSSL SSL_connect: Connection reset by peer in connection to nvidia.github.io:443 ]
Error: Failed to download metadata for repo 'libnvidia-container': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
- 拉取镜像
docker pull ollama/ollama
- 创建volume
docker volume create ollama
3.配置nvidia-container-toolkit
NewerOlder