月度归档:2024年05月

windows7 CDC驱动

保存到文件usbser.inf 文件。
windows管理中载入驱动,选择刚刚保存的文件。

;/*++
;
;Copyright (c) Microsoft Corporation.  All rights reserved.
;
;Module Name:
;    usbser.inf
;
;Abstract:
;    INF file for installing the USB Serial driver
;
;--*/

;*****************************************
; Version section
;*****************************************
[Version]
Signature   = "$WINDOWS NT$"
Class       = Ports
ClassGUID   = {4D36E978-E325-11CE-BFC1-08002BE10318}
Provider    = %MSFT%
PnpLockdown = 1
DriverVer = 06/21/2006,10.0.18362.1

[DestinationDirs]
DefaultDestDir = 12
UsbSerial_CopyFiles = 12

;[SourceDisksNames]
;3426 = windows cd

;[SourceDisksFiles]
;usbser.sys = 3426

[ControlFlags]
ExcludeFromSelect = *

;*****************************************
; Install Section
;*****************************************

[Manufacturer]
%MSFT% = Standard, NTamd64

[Standard.NTamd64]
%UsbSerial.DeviceDesc% = UsbSerial_Install, USB\Class_02&SubClass_02&Prot_01
%UsbSerial.DeviceDesc% = UsbSerial_Install, USB\Class_02&SubClass_02

; USB modem filter driver for use with Include/Needs only
%UsbSerialModem.DeviceDesc% = UsbSerial_ModemFilter_Install

[UsbSerial_Install.NT]
CopyFiles   = UsbSerial_CopyFiles
AddReg      = UsbSerial_AddReg
AddProperty = UsbSerial_AddProperty

; intentionally blank so that in future if we ever put anything in here
; it will get get picked up via Include/Needs
[UsbSerial_Install.NT.Hw]

[UsbSerial_CopyFiles]
usbser.sys,,,0x100

[UsbSerial_AddReg]
HKR,,PortSubClass,%REG_BINARY%,02
HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

[UsbSerial_AddProperty]
GenericDriverInstalled,,,,1

;*****************************************
; Service installation section
;*****************************************

[UsbSerial_Install.NT.Services]
AddService = usbser,0x00000002,UsbSerial_Service_Install, UsbSerial_EventLog_Install

[UsbSerial_Service_Install]
DisplayName   = %UsbSerial.DriverDesc%
ServiceType   = 1           ; SERVICE_KERNEL_DRIVER
StartType     = 3           ; SERVICE_DEMAND_START
ErrorControl  = 1           ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\usbser.sys

[UsbSerial_EventLog_Install]
AddReg=UsbSerial_EventLog_AddReg

[UsbSerial_EventLog_AddReg]
HKR,,EventMessageFile,0x00020000,"%%SystemRoot%%\System32\IoLogMsg.dll;%%SystemRoot%%\System32\Drivers\usbser.sys"
HKR,,TypesSupported,0x00010001,7

;***********************************************************
; Modem install section to install usbser as a lower filter
; (Include/Needs from modem INFs)
;***********************************************************

[UsbSerial_ModemFilter_Install]
CopyFiles=UsbSerial_CopyFiles 

[UsbSerial_ModemFilter_Install.Hw]
AddReg=UsbSerial_ModemFilter_AddReg

[UsbSerial_ModemFilter_AddReg]
HKR,,LowerFilters,%REG_MULTI_SZ%,"usbser"

[UsbSerial_ModemFilter_Install.Services]
AddService=usbser,,UsbSerial_Service_Install,UsbSerial_EventLog_Install

;*****************************************
; Strings section
;*****************************************

[Strings]
; localizable
MSFT                      = "Microsoft"
UsbSerial.DeviceDesc      = "USB Serial Device"
UsbSerialModem.DeviceDesc = "USB Serial Modem Device"
UsbSerial.DriverDesc      = "Microsoft USB Serial Driver"

; non-localizable
REG_BINARY   = 0x00000001
REG_MULTI_SZ = 0x00010000

大模型速度测试

VULTR下顶配 共享12核24G 144刀每月【我就开3小时】

  • 500 GB NVMe12 vCPUs24 GB500 GB NVMe12 TB
  • $144/month
  • $0.214/hour

之前用Intel(R) Xeon(R) CPU E5-2683 v4 @ 2.10GHz x2 2GB 跑phi3:4b很慢看看这个效果怎么样。


root@vultr:~# free
               total        used        free      shared  buff/cache   available
Mem:        24597624      275424    23568548        1252      753652    23980252
Swap:        8388604           0     8388604
root@vultr:~# cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 23
model           : 49
model name      : AMD EPYC-Rome Processor
stepping        : 0
microcode       : 0x1000065
cpu MHz         : 1996.248
cache size      : 512 KB
physical id     : 0
siblings        : 12
core id         : 0
cpu cores       : 6

位置 硅谷 Silicon Valley 
江苏电信ping 168-170ms

安装
http://el.psy.congroo.com/archives/735

phi3:4b 运行不错非常迅速 50秒
mistral:7b 速度略慢 可以接受 60s

试试qwen:110b看看 69GB 23333 2分钟才出来不到10个字

VPS初探大模型OLLAMA

安装OLLAMA


系统:Ubuntu 22.04

curl https://ollama.ai/install.sh | sh

安装完成:

root@linux:~# ollama --version
ollama version is 0.1.34

开启API外部访问
Environment="OLLAMA_HOST=0.0.0.0"

vi /etc/systemd/system/ollama.service
#在最下面添加

#文件信息
[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/local/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
Environment="OLLAMA_HOST=0.0.0.0"

#添加开放


[Install]
WantedBy=default.target


#重启服务
systemctl daemon-reload
systemctl restart ollama

使用


ollama run qwen:0.5b
VPS 也就这个跨域搞搞 qwen:0.5b 不然负载太高 llam2 7b(70亿数据要一分钟)

 ollama run qwen:0.5b
#直接命令行输入,即可自动下载 千问 5亿数据模型(务必联网)

#运行结束 即可在下面输入
root@linux:~# ollama run qwen:0.5b
pulling manifest
pulling manifest
pulling fad2a06e4cc7... 100% ▕████████████████▏ 394 MB
pulling 41c2cf8c272f... 100% ▕████████████████▏ 7.3 KB
pulling 1da0581fd4ce... 100% ▕████████████████▏  130 B
pulling f02dd72bb242... 100% ▕████████████████▏   59 B
pulling ea0a531a015b... 100% ▕████████████████▏  485 B
verifying sha256 digest
writing manifest
removing any unused layers
success
>>> Send a message (/? for help)

相关命令


>>> /?
Available Commands:
  /set            Set session variables
  /show           Show model information
  /load <model>   Load a session or model 载入之前的回话
  /save <model>   Save your current session 保存回话
  /clear          Clear session context
  /bye            Exit 退出
  /?, /help       Help for a command
  /? shortcuts    Help for keyboard shortcuts

Use """ to begin a multi-line message.

安装DOCKER

sudo apt update && sudo apt install docker.io apparmor -y

安装OpenUI 本机情况下 (默认端口11434)

sudo docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main

安装在其他IP服务器上

sudo docker run -d -p 3000:8080 -e OLLAMA_API_BASE_URL=http://<你的服务的IP地址>:11434/api -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main

 E5-2683 v4 @ 2.10GHz x2 2G VPS

llama2 7B 不行 及其卡

qwen:0.5b 极快
codegemma:9b不行 及其卡
phi3:4b 不行 及其卡

联网 network模块

import network
#联网
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect(web['wifi'], web['password'])

#AP
ap = network.WLAN(network.AP_IF)
ap.active(True)
ap.config(essid="wifi_mag", password="12345678")


#IP信息
wlan.ifconfig()[0]
wlan.isconnected()
#是否联网