- Jul 24, 2017
- 2,089
- 19,623
The original.I do that in the original file or in the translated one?
The original.I do that in the original file or in the translated one?
Not sure I understand. The estimate is based on dollars and is calculated by going through the files and counting all the tokens using OpenAI's tokenizer. I have to guess what the output is going to be so its not 100% accurate, but generally the estimate is always around 20% higher than what the actual cost will be.
The 0.002 is the cents per token. It might be out of date I don't use 3.5 anymore.View attachment 3608110
What, exactly, does 0.002 represent? I find that when I do translations using the latest model, GPT-3.5-turbo-0125, my prices are enormously lower than the estimate - around 10% of the given estimate. I notice that you use a different model spec in your default ENV config - that may cost more than the latest one. The newer models are better and cheaper. Anyway, the OpenAI pricing page lists prices in dollars per million tokens - I'd like to update the pricing estimate to be closer to the actual value I'm using.
View attachment 3608112
Those two spikes represent two full passes of the game I was working on translating, plus additional passes. The cost estimate was $11 per pass, but as you can see, the actual cost was enormously lower.
Are you actually just using the old, expensive model? You could be spending 90% less money.
Consider trying 3.5-turbo-0125. It's pretty good.The 0.002 is the cents per token. It might be out of date I don't use 3.5 anymore.
I'm using GPT-4-Turbo which is 0.01 and 0.03 per token. Since the estimate doesn't account for requests that fail, it multiplies the entire cost of each request by 2. That's why the estimate is always higher than the actual cost.
The estimate is essentially a worst case scenario cost analysis. Basically if you are going to invest in a game, it tells you the max it can potentially cost. But often the actual costs are lower because not every requests is going to fail obviously. The whole purpose is to make sure you know exactly how much you are going to likely spend.
Not good enough for my purposes.Consider trying 3.5-turbo-0125. It's pretty good.
GAMEUPDATE.bat
for any Linux users. Works for me on Ubuntu. Save to GAMEUPDATE.sh
, give execution rights with sudo chmod +x GAMEUPDATE.sh
, and run with ./GAMEUPDATE.sh
.#!/bin/bash
# Check if patch-config.txt exists
if [ ! -f ./patch-config.txt ]; then
echo "Config file (patch-config.txt) not found! Assuming no patching needed."
exit 0
fi
# Read configuration from file
source ./patch-config.txt
USERNAME=$(echo $username | tr -d '\r')
REPO=$(echo $repo | tr -d '\r')
BRANCH=$(echo $branch | tr -d '\r')
# Get the latest hash
echo "Getting latest commit SHA hash."
LATEST_PATCH_SHA=$(curl -s "https://api.github.com/repos/${USERNAME}/${REPO}/branches/${BRANCH}" | sha256sum | tr -d "[:space:]-")
# Compare with previous hash
if [ -f previous_patch_sha.txt ]; then
PREVIOUS_PATCH_SHA=$(head -n 1 previous_patch_sha.txt | tr -d '\r')
if [ "$LATEST_PATCH_SHA" = "$PREVIOUS_PATCH_SHA" ]; then
echo "Patch is up to date."
exit 0
else
echo "Update found! Patching..."
fi
else
echo "Previous SHA hash not found!"
echo "Assuming first time patching..."
fi
# Download zip file
echo "Downloading latest patch..."
curl -s https://codeload.github.com/$USERNAME/$REPO/zip/refs/heads/$BRANCH -o repo.zip
# Extract contents
echo "Extracting..."
rm -fr $REPO-$BRANCH
unzip -qq repo.zip
# Apply patch
echo "Applying patch..."
cp -r $REPO-$BRANCH/* ./
# Clean up
echo "Cleaning up..."
rm -f repo.zip
rm -fr $REPO-$BRANCH
# Store latest SHA for next check
echo -n $LATEST_PATCH_SHA > previous_patch_sha.txt