feirisu's recent timeline updates
feirisu

feirisu

V2EX member #446181, joined on 2019-10-12 16:47:14 +08:00
feirisu's recent replies
有没有可能是用免费的国产 api 冒充 gpt 。
May 29, 2024
Replied to a topic by 934831065ldc OpenAI 使用 gpt4o,如何计算图片 token?
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;
}
自己付款公司报销吧,简单点

公司业务中转慎用,有假中转,给你换别便宜模型返回数据。。。
May 24, 2024
Replied to a topic by jabari 程序员 Windows 11 是不是有内存泄漏问题?
任务管理器的用户标签里有没有多个用户登入?
代码都不行,经常调用某些类不存在的函数,也就早期 gpt3.5 的水平,中文理解可能略强一点
用 winrar 呀,几年前的干净版本
Apr 25, 2024
Replied to a topic by dododada 程序员 AI 服务器配置报价
这俩 4090 能跑 70B 的 chat 模型吗
Apr 16, 2024
Replied to a topic by AoEiuV020JP 程序员 电脑内存都被谁占了
Apr 16, 2024
Replied to a topic by AoEiuV020JP 程序员 电脑内存都被谁占了
看看性能那里,“已提交”是虚拟内存,看看“使用中”多少,这个是物理的内存
@twofox 不用那些二道贩子,还能更便宜点
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   943 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 20ms · UTC 21:27 · PVG 05:27 · LAX 14:27 · JFK 17:27
♥ Do have faith in what you're doing.