03_Cursor配置
1. 资源准备
2. Cursor 安装
下载完成后,双击.exe文件启动安装程序。
按照提示接受许可协议,选择安装路径,可以选择创建桌面快捷方式或添加到系统路径以方便命令行访问。
完成安装后,点击“Finish”退出安装程序
3.注册与登录
如果本机之前安装过 VS Code,可以导入 VS Code 的扩展:
首次使用 Cursor 时,需要注册一个新账号或使用已有账号进行登录,也可以用 Github 等授权登录。
这里勾选默认即可,点 Continue 按钮完成设置:
4. Cursor 配置
› 打开 Settings → 进入 Models 面 板
› OpenAI API Key
- 填入 创建的自定义令牌
› OpenAI Base URL
- https://yibuapi.com/v1
› Add model 选项:
- 输入与令牌绑定的「自定义模型名称」,查看支持的模型请参考这篇教程模型在线查询
5.成功验证
› 重启 Cursor IDE 激活配置
› 按住ctrl+K键,弹出一行窗口,输入自己想要的功能。
他会自己一行一行快速写代码。这里我把他写的alexnet模型代码贴在这里。
class AlexNet(nn.Module):
def __init__(self, num_classes=1000):
super(AlexNet, self).__init__()
self.features = nn.Sequential(
nn.Conv2d(3, 64, kernel_size=11, stride=4, padding=2),
nn.ReLU(inplace=True),
nn.MaxPool2d(kernel_size=3, stride=2),
nn.Conv2d(64, 192, kernel_size=5, padding=2),
nn.ReLU(inplace=True),
nn.MaxPool2d(kernel_size=3, stride=2),
nn.Conv2d(192, 384, kernel_size=3, padding=1),
nn.ReLU(inplace=True),
nn.Conv2d(384, 256, kernel_size=3, padding=1),
nn.ReLU(inplace=True),
nn.Conv2d(256, 256, kernel_size=3, padding=1),
nn.ReLU(inplace=True),
nn.MaxPool2d(kernel_size=3, stride=2),
)
self.avgpool = nn.AdaptiveAvgPool2d((6, 6))
self.classifier = nn.Sequential(
nn.Dropout(),
nn.Linear(256 * 6 * 6, 4096),
nn.ReLU(inplace=True),
nn.Dropout(),
nn.Linear(4096, 4096),
nn.ReLU(inplace=True),
nn.Linear(4096, num_classes),
)
def forward(self, x):
x = self.features(x)
x = self.avgpool(x)
x = x.view(x.size(0), 256 * 6 * 6)
x = self.classifier(x)
return x
6. 联系客服
修改于 2025-04-17 06:22:12