feirisu

feirisu

V2EX 第 446181 号会员,加入于 2019-10-12 16:47:14 +08:00
feirisu
程序员  •  feirisu
Windows 下开发小应用 GUI,真的很难选方案
2024 年 5 月 13 日  •  最后回复来自 hanxiV2EX
124
OpenAI  •  feirisu
Gemini Pro 的 API 和国内的模型一样有前置关键词过滤
2023 年 12 月 19 日  •  最后回复来自 feirisu
6
云计算  •  feirisu
腾讯云的 618 又加码了
2022 年 6 月 19 日  •  最后回复来自 wkingnet
9
程序员  •  feirisu
域名在国内部分区域被墙有遇到过的吗?
2022 年 5 月 26 日  •  最后回复来自 feirisu
26
宽带症候群  •  feirisu
内网接入 LAN 口设备会影响其他设备的 DNS 解析
2021 年 7 月 3 日  •  最后回复来自 tankren
8
feirisu 最近回复了
回复了 cloud2000 创建的主题 › 那些远低于官方价格的 Claude 中转站是什么原理?2024 年 6 月 19 日
有没有可能是用免费的国产 api 冒充 gpt 。
回复了 934831065ldc 创建的主题 › 使用 gpt4o,如何计算图片 token?2024 年 5 月 29 日
c#代码,就是 auto 没测试是怎么自动 low 和 high 的


public static int CalculateImageTokens(int width, int height, ImageDetailMode detailMode)
{
const int lowDetailCost = 85;
const int highDetailCostPerSquare = 170;
const int highDetailBaseCost = 85;
const int maxDimension = 2048;
const int targetShortSide = 768;
const int squareSize = 512;


if (detailMode == ImageDetailMode.None)
{
detailMode = ImageDetailMode.High; //
}

if (detailMode == ImageDetailMode.Low)
{
return lowDetailCost;
}
else if (detailMode == ImageDetailMode.High)
{
bool scaledToMax = false;

// Scale down the image if either dimension exceeds the maximum allowed.
if (width > maxDimension || height > maxDimension)
{
double scaleFactor = Math.Min((double)maxDimension / width, (double)maxDimension / height);
width = (int)(width * scaleFactor);
height = (int)(height * scaleFactor);
scaledToMax = true;
}

// Further scale down the image only if it has been scaled in the previous step.
if (scaledToMax)
{
double scaleToShortestSideFactor = (double)targetShortSide / Math.Min(width, height);
width = (int)(width * scaleToShortestSideFactor);
height = (int)(height * scaleToShortestSideFactor);
}

// Calculate how many 512px squares are needed to cover the image.
int squaresAcross = (int)Math.Ceiling((double)width / squareSize);
int squaresDown = (int)Math.Ceiling((double)height / squareSize);
int totalSquares = squaresAcross * squaresDown;

// Calculate final token cost for high detail images.
return highDetailCostPerSquare * totalSquares + highDetailBaseCost;
}

return lowDetailCost;
}
回复了 macaodoll 创建的主题 › 求教下谷歌 gemini 如何才能方便公司对接使用,国内公司2024 年 5 月 28 日
自己付款公司报销吧,简单点

公司业务中转慎用,有假中转,给你换别便宜模型返回数据。。。
回复了 jabari 创建的主题 › Windows 11 是不是有内存泄漏问题?2024 年 5 月 24 日
任务管理器的用户标签里有没有多个用户登入?
回复了 teli 创建的主题 › 瞎扯大模型,文心一言和 kimi,应该押注哪一个?2024 年 5 月 17 日
代码都不行,经常调用某些类不存在的函数,也就早期 gpt3.5 的水平,中文理解可能略强一点
回复了 cnhongwei 创建的主题 › 下载了一下假的 bandizip,这种网站和软件就没有办法了吗。2024 年 4 月 25 日
用 winrar 呀,几年前的干净版本
回复了 dododada 创建的主题 › AI 服务器配置报价2024 年 4 月 25 日
这俩 4090 能跑 70B 的 chat 模型吗
回复了 AoEiuV020JP 创建的主题 › 电脑内存都被谁占了2024 年 4 月 16 日
回复了 AoEiuV020JP 创建的主题 › 电脑内存都被谁占了2024 年 4 月 16 日
看看性能那里,“已提交”是虚拟内存,看看“使用中”多少,这个是物理的内存
回复了 twofox 创建的主题 › 封号后续:找了 openai 的客服之后,依旧无法解封2024 年 4 月 15 日
@twofox 不用那些二道贩子,还能更便宜点
© 2026 V2EX · 17ms · 3.9.8.5