Skip to content

Instantly share code, notes, and snippets.

@TeddyHuang-00
TeddyHuang-00 / extract.jq
Last active June 12, 2025 14:21
Helper script to extract missing translations from en to target language and populate with placeholder
# Extract English and specified target language translations, and add placeholders for missing target language translations
# Usage:
# Full output: jq --arg target "zh-Hans" -f extract.jq Localizable.xcstrings
# Placeholder-only output: jq --arg target "zh-Hans" --arg filter "true" -f extract.jq Localizable.xcstrings
# Parameters:
# - target: Target language code (e.g., zh-Hans, zh-Hant, ja, ko, fr, de, etc.)
# - filter: Optional, set to "true" to output only entries that need translations (default: false)
(
if ($ARGS.named | has("target")) then
@TeddyHuang-00
TeddyHuang-00 / convert_weight.py
Last active September 12, 2024 04:48
Convert TimesFM to PyTorch
import sys
from pathlib import Path
import numpy as np
import torch
sys.path.append("./src")
from src.model import PatchedTimeSeriesDecoder, TimesFMConfig