@synsci/cli-darwin-x64 1.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/skills/accelerate/SKILL.md +332 -0
- package/bin/skills/accelerate/references/custom-plugins.md +453 -0
- package/bin/skills/accelerate/references/megatron-integration.md +489 -0
- package/bin/skills/accelerate/references/performance.md +525 -0
- package/bin/skills/audiocraft/SKILL.md +564 -0
- package/bin/skills/audiocraft/references/advanced-usage.md +666 -0
- package/bin/skills/audiocraft/references/troubleshooting.md +504 -0
- package/bin/skills/autogpt/SKILL.md +403 -0
- package/bin/skills/autogpt/references/advanced-usage.md +535 -0
- package/bin/skills/autogpt/references/troubleshooting.md +420 -0
- package/bin/skills/awq/SKILL.md +310 -0
- package/bin/skills/awq/references/advanced-usage.md +324 -0
- package/bin/skills/awq/references/troubleshooting.md +344 -0
- package/bin/skills/axolotl/SKILL.md +158 -0
- package/bin/skills/axolotl/references/api.md +5548 -0
- package/bin/skills/axolotl/references/dataset-formats.md +1029 -0
- package/bin/skills/axolotl/references/index.md +15 -0
- package/bin/skills/axolotl/references/other.md +3563 -0
- package/bin/skills/bigcode-evaluation-harness/SKILL.md +405 -0
- package/bin/skills/bigcode-evaluation-harness/references/benchmarks.md +393 -0
- package/bin/skills/bigcode-evaluation-harness/references/custom-tasks.md +424 -0
- package/bin/skills/bigcode-evaluation-harness/references/issues.md +394 -0
- package/bin/skills/bitsandbytes/SKILL.md +411 -0
- package/bin/skills/bitsandbytes/references/memory-optimization.md +521 -0
- package/bin/skills/bitsandbytes/references/qlora-training.md +521 -0
- package/bin/skills/bitsandbytes/references/quantization-formats.md +447 -0
- package/bin/skills/blip-2/SKILL.md +564 -0
- package/bin/skills/blip-2/references/advanced-usage.md +680 -0
- package/bin/skills/blip-2/references/troubleshooting.md +526 -0
- package/bin/skills/chroma/SKILL.md +406 -0
- package/bin/skills/chroma/references/integration.md +38 -0
- package/bin/skills/clip/SKILL.md +253 -0
- package/bin/skills/clip/references/applications.md +207 -0
- package/bin/skills/constitutional-ai/SKILL.md +290 -0
- package/bin/skills/crewai/SKILL.md +498 -0
- package/bin/skills/crewai/references/flows.md +438 -0
- package/bin/skills/crewai/references/tools.md +429 -0
- package/bin/skills/crewai/references/troubleshooting.md +480 -0
- package/bin/skills/deepspeed/SKILL.md +141 -0
- package/bin/skills/deepspeed/references/08.md +17 -0
- package/bin/skills/deepspeed/references/09.md +173 -0
- package/bin/skills/deepspeed/references/2020.md +378 -0
- package/bin/skills/deepspeed/references/2023.md +279 -0
- package/bin/skills/deepspeed/references/assets.md +179 -0
- package/bin/skills/deepspeed/references/index.md +35 -0
- package/bin/skills/deepspeed/references/mii.md +118 -0
- package/bin/skills/deepspeed/references/other.md +1191 -0
- package/bin/skills/deepspeed/references/tutorials.md +6554 -0
- package/bin/skills/dspy/SKILL.md +590 -0
- package/bin/skills/dspy/references/examples.md +663 -0
- package/bin/skills/dspy/references/modules.md +475 -0
- package/bin/skills/dspy/references/optimizers.md +566 -0
- package/bin/skills/faiss/SKILL.md +221 -0
- package/bin/skills/faiss/references/index_types.md +280 -0
- package/bin/skills/flash-attention/SKILL.md +367 -0
- package/bin/skills/flash-attention/references/benchmarks.md +215 -0
- package/bin/skills/flash-attention/references/transformers-integration.md +293 -0
- package/bin/skills/gguf/SKILL.md +427 -0
- package/bin/skills/gguf/references/advanced-usage.md +504 -0
- package/bin/skills/gguf/references/troubleshooting.md +442 -0
- package/bin/skills/gptq/SKILL.md +450 -0
- package/bin/skills/gptq/references/calibration.md +337 -0
- package/bin/skills/gptq/references/integration.md +129 -0
- package/bin/skills/gptq/references/troubleshooting.md +95 -0
- package/bin/skills/grpo-rl-training/README.md +97 -0
- package/bin/skills/grpo-rl-training/SKILL.md +572 -0
- package/bin/skills/grpo-rl-training/examples/reward_functions_library.py +393 -0
- package/bin/skills/grpo-rl-training/templates/basic_grpo_training.py +228 -0
- package/bin/skills/guidance/SKILL.md +572 -0
- package/bin/skills/guidance/references/backends.md +554 -0
- package/bin/skills/guidance/references/constraints.md +674 -0
- package/bin/skills/guidance/references/examples.md +767 -0
- package/bin/skills/hqq/SKILL.md +445 -0
- package/bin/skills/hqq/references/advanced-usage.md +528 -0
- package/bin/skills/hqq/references/troubleshooting.md +503 -0
- package/bin/skills/hugging-face-cli/SKILL.md +191 -0
- package/bin/skills/hugging-face-cli/references/commands.md +954 -0
- package/bin/skills/hugging-face-cli/references/examples.md +374 -0
- package/bin/skills/hugging-face-datasets/SKILL.md +547 -0
- package/bin/skills/hugging-face-datasets/examples/diverse_training_examples.json +239 -0
- package/bin/skills/hugging-face-datasets/examples/system_prompt_template.txt +196 -0
- package/bin/skills/hugging-face-datasets/examples/training_examples.json +176 -0
- package/bin/skills/hugging-face-datasets/scripts/dataset_manager.py +522 -0
- package/bin/skills/hugging-face-datasets/scripts/sql_manager.py +844 -0
- package/bin/skills/hugging-face-datasets/templates/chat.json +55 -0
- package/bin/skills/hugging-face-datasets/templates/classification.json +62 -0
- package/bin/skills/hugging-face-datasets/templates/completion.json +51 -0
- package/bin/skills/hugging-face-datasets/templates/custom.json +75 -0
- package/bin/skills/hugging-face-datasets/templates/qa.json +54 -0
- package/bin/skills/hugging-face-datasets/templates/tabular.json +81 -0
- package/bin/skills/hugging-face-evaluation/SKILL.md +656 -0
- package/bin/skills/hugging-face-evaluation/examples/USAGE_EXAMPLES.md +382 -0
- package/bin/skills/hugging-face-evaluation/examples/artificial_analysis_to_hub.py +141 -0
- package/bin/skills/hugging-face-evaluation/examples/example_readme_tables.md +135 -0
- package/bin/skills/hugging-face-evaluation/examples/metric_mapping.json +50 -0
- package/bin/skills/hugging-face-evaluation/requirements.txt +20 -0
- package/bin/skills/hugging-face-evaluation/scripts/evaluation_manager.py +1374 -0
- package/bin/skills/hugging-face-evaluation/scripts/inspect_eval_uv.py +104 -0
- package/bin/skills/hugging-face-evaluation/scripts/inspect_vllm_uv.py +317 -0
- package/bin/skills/hugging-face-evaluation/scripts/lighteval_vllm_uv.py +303 -0
- package/bin/skills/hugging-face-evaluation/scripts/run_eval_job.py +98 -0
- package/bin/skills/hugging-face-evaluation/scripts/run_vllm_eval_job.py +331 -0
- package/bin/skills/hugging-face-evaluation/scripts/test_extraction.py +206 -0
- package/bin/skills/hugging-face-jobs/SKILL.md +1041 -0
- package/bin/skills/hugging-face-jobs/index.html +216 -0
- package/bin/skills/hugging-face-jobs/references/hardware_guide.md +336 -0
- package/bin/skills/hugging-face-jobs/references/hub_saving.md +352 -0
- package/bin/skills/hugging-face-jobs/references/token_usage.md +546 -0
- package/bin/skills/hugging-face-jobs/references/troubleshooting.md +475 -0
- package/bin/skills/hugging-face-jobs/scripts/cot-self-instruct.py +718 -0
- package/bin/skills/hugging-face-jobs/scripts/finepdfs-stats.py +546 -0
- package/bin/skills/hugging-face-jobs/scripts/generate-responses.py +587 -0
- package/bin/skills/hugging-face-model-trainer/SKILL.md +711 -0
- package/bin/skills/hugging-face-model-trainer/references/gguf_conversion.md +296 -0
- package/bin/skills/hugging-face-model-trainer/references/hardware_guide.md +283 -0
- package/bin/skills/hugging-face-model-trainer/references/hub_saving.md +364 -0
- package/bin/skills/hugging-face-model-trainer/references/reliability_principles.md +371 -0
- package/bin/skills/hugging-face-model-trainer/references/trackio_guide.md +189 -0
- package/bin/skills/hugging-face-model-trainer/references/training_methods.md +150 -0
- package/bin/skills/hugging-face-model-trainer/references/training_patterns.md +203 -0
- package/bin/skills/hugging-face-model-trainer/references/troubleshooting.md +282 -0
- package/bin/skills/hugging-face-model-trainer/scripts/convert_to_gguf.py +424 -0
- package/bin/skills/hugging-face-model-trainer/scripts/dataset_inspector.py +417 -0
- package/bin/skills/hugging-face-model-trainer/scripts/estimate_cost.py +150 -0
- package/bin/skills/hugging-face-model-trainer/scripts/train_dpo_example.py +106 -0
- package/bin/skills/hugging-face-model-trainer/scripts/train_grpo_example.py +89 -0
- package/bin/skills/hugging-face-model-trainer/scripts/train_sft_example.py +122 -0
- package/bin/skills/hugging-face-paper-publisher/SKILL.md +627 -0
- package/bin/skills/hugging-face-paper-publisher/examples/example_usage.md +327 -0
- package/bin/skills/hugging-face-paper-publisher/references/quick_reference.md +216 -0
- package/bin/skills/hugging-face-paper-publisher/scripts/paper_manager.py +508 -0
- package/bin/skills/hugging-face-paper-publisher/templates/arxiv.md +299 -0
- package/bin/skills/hugging-face-paper-publisher/templates/ml-report.md +358 -0
- package/bin/skills/hugging-face-paper-publisher/templates/modern.md +319 -0
- package/bin/skills/hugging-face-paper-publisher/templates/standard.md +201 -0
- package/bin/skills/hugging-face-tool-builder/SKILL.md +115 -0
- package/bin/skills/hugging-face-tool-builder/references/baseline_hf_api.py +57 -0
- package/bin/skills/hugging-face-tool-builder/references/baseline_hf_api.sh +40 -0
- package/bin/skills/hugging-face-tool-builder/references/baseline_hf_api.tsx +57 -0
- package/bin/skills/hugging-face-tool-builder/references/find_models_by_paper.sh +230 -0
- package/bin/skills/hugging-face-tool-builder/references/hf_enrich_models.sh +96 -0
- package/bin/skills/hugging-face-tool-builder/references/hf_model_card_frontmatter.sh +188 -0
- package/bin/skills/hugging-face-tool-builder/references/hf_model_papers_auth.sh +171 -0
- package/bin/skills/hugging-face-trackio/SKILL.md +65 -0
- package/bin/skills/hugging-face-trackio/references/logging_metrics.md +206 -0
- package/bin/skills/hugging-face-trackio/references/retrieving_metrics.md +223 -0
- package/bin/skills/huggingface-tokenizers/SKILL.md +516 -0
- package/bin/skills/huggingface-tokenizers/references/algorithms.md +653 -0
- package/bin/skills/huggingface-tokenizers/references/integration.md +637 -0
- package/bin/skills/huggingface-tokenizers/references/pipeline.md +723 -0
- package/bin/skills/huggingface-tokenizers/references/training.md +565 -0
- package/bin/skills/instructor/SKILL.md +740 -0
- package/bin/skills/instructor/references/examples.md +107 -0
- package/bin/skills/instructor/references/providers.md +70 -0
- package/bin/skills/instructor/references/validation.md +606 -0
- package/bin/skills/knowledge-distillation/SKILL.md +458 -0
- package/bin/skills/knowledge-distillation/references/minillm.md +334 -0
- package/bin/skills/lambda-labs/SKILL.md +545 -0
- package/bin/skills/lambda-labs/references/advanced-usage.md +611 -0
- package/bin/skills/lambda-labs/references/troubleshooting.md +530 -0
- package/bin/skills/langchain/SKILL.md +480 -0
- package/bin/skills/langchain/references/agents.md +499 -0
- package/bin/skills/langchain/references/integration.md +562 -0
- package/bin/skills/langchain/references/rag.md +600 -0
- package/bin/skills/langsmith/SKILL.md +422 -0
- package/bin/skills/langsmith/references/advanced-usage.md +548 -0
- package/bin/skills/langsmith/references/troubleshooting.md +537 -0
- package/bin/skills/litgpt/SKILL.md +469 -0
- package/bin/skills/litgpt/references/custom-models.md +568 -0
- package/bin/skills/litgpt/references/distributed-training.md +451 -0
- package/bin/skills/litgpt/references/supported-models.md +336 -0
- package/bin/skills/litgpt/references/training-recipes.md +619 -0
- package/bin/skills/llama-cpp/SKILL.md +258 -0
- package/bin/skills/llama-cpp/references/optimization.md +89 -0
- package/bin/skills/llama-cpp/references/quantization.md +213 -0
- package/bin/skills/llama-cpp/references/server.md +125 -0
- package/bin/skills/llama-factory/SKILL.md +80 -0
- package/bin/skills/llama-factory/references/_images.md +23 -0
- package/bin/skills/llama-factory/references/advanced.md +1055 -0
- package/bin/skills/llama-factory/references/getting_started.md +349 -0
- package/bin/skills/llama-factory/references/index.md +19 -0
- package/bin/skills/llama-factory/references/other.md +31 -0
- package/bin/skills/llamaguard/SKILL.md +337 -0
- package/bin/skills/llamaindex/SKILL.md +569 -0
- package/bin/skills/llamaindex/references/agents.md +83 -0
- package/bin/skills/llamaindex/references/data_connectors.md +108 -0
- package/bin/skills/llamaindex/references/query_engines.md +406 -0
- package/bin/skills/llava/SKILL.md +304 -0
- package/bin/skills/llava/references/training.md +197 -0
- package/bin/skills/lm-evaluation-harness/SKILL.md +490 -0
- package/bin/skills/lm-evaluation-harness/references/api-evaluation.md +490 -0
- package/bin/skills/lm-evaluation-harness/references/benchmark-guide.md +488 -0
- package/bin/skills/lm-evaluation-harness/references/custom-tasks.md +602 -0
- package/bin/skills/lm-evaluation-harness/references/distributed-eval.md +519 -0
- package/bin/skills/long-context/SKILL.md +536 -0
- package/bin/skills/long-context/references/extension_methods.md +468 -0
- package/bin/skills/long-context/references/fine_tuning.md +611 -0
- package/bin/skills/long-context/references/rope.md +402 -0
- package/bin/skills/mamba/SKILL.md +260 -0
- package/bin/skills/mamba/references/architecture-details.md +206 -0
- package/bin/skills/mamba/references/benchmarks.md +255 -0
- package/bin/skills/mamba/references/training-guide.md +388 -0
- package/bin/skills/megatron-core/SKILL.md +366 -0
- package/bin/skills/megatron-core/references/benchmarks.md +249 -0
- package/bin/skills/megatron-core/references/parallelism-guide.md +404 -0
- package/bin/skills/megatron-core/references/production-examples.md +473 -0
- package/bin/skills/megatron-core/references/training-recipes.md +547 -0
- package/bin/skills/miles/SKILL.md +315 -0
- package/bin/skills/miles/references/api-reference.md +141 -0
- package/bin/skills/miles/references/troubleshooting.md +352 -0
- package/bin/skills/mlflow/SKILL.md +704 -0
- package/bin/skills/mlflow/references/deployment.md +744 -0
- package/bin/skills/mlflow/references/model-registry.md +770 -0
- package/bin/skills/mlflow/references/tracking.md +680 -0
- package/bin/skills/modal/SKILL.md +341 -0
- package/bin/skills/modal/references/advanced-usage.md +503 -0
- package/bin/skills/modal/references/troubleshooting.md +494 -0
- package/bin/skills/model-merging/SKILL.md +539 -0
- package/bin/skills/model-merging/references/evaluation.md +462 -0
- package/bin/skills/model-merging/references/examples.md +428 -0
- package/bin/skills/model-merging/references/methods.md +352 -0
- package/bin/skills/model-pruning/SKILL.md +495 -0
- package/bin/skills/model-pruning/references/wanda.md +347 -0
- package/bin/skills/moe-training/SKILL.md +526 -0
- package/bin/skills/moe-training/references/architectures.md +432 -0
- package/bin/skills/moe-training/references/inference.md +348 -0
- package/bin/skills/moe-training/references/training.md +425 -0
- package/bin/skills/nanogpt/SKILL.md +290 -0
- package/bin/skills/nanogpt/references/architecture.md +382 -0
- package/bin/skills/nanogpt/references/data.md +476 -0
- package/bin/skills/nanogpt/references/training.md +564 -0
- package/bin/skills/nemo-curator/SKILL.md +383 -0
- package/bin/skills/nemo-curator/references/deduplication.md +87 -0
- package/bin/skills/nemo-curator/references/filtering.md +102 -0
- package/bin/skills/nemo-evaluator/SKILL.md +494 -0
- package/bin/skills/nemo-evaluator/references/adapter-system.md +340 -0
- package/bin/skills/nemo-evaluator/references/configuration.md +447 -0
- package/bin/skills/nemo-evaluator/references/custom-benchmarks.md +315 -0
- package/bin/skills/nemo-evaluator/references/execution-backends.md +361 -0
- package/bin/skills/nemo-guardrails/SKILL.md +297 -0
- package/bin/skills/nnsight/SKILL.md +436 -0
- package/bin/skills/nnsight/references/README.md +78 -0
- package/bin/skills/nnsight/references/api.md +344 -0
- package/bin/skills/nnsight/references/tutorials.md +300 -0
- package/bin/skills/openrlhf/SKILL.md +249 -0
- package/bin/skills/openrlhf/references/algorithm-comparison.md +404 -0
- package/bin/skills/openrlhf/references/custom-rewards.md +530 -0
- package/bin/skills/openrlhf/references/hybrid-engine.md +287 -0
- package/bin/skills/openrlhf/references/multi-node-training.md +454 -0
- package/bin/skills/outlines/SKILL.md +652 -0
- package/bin/skills/outlines/references/backends.md +615 -0
- package/bin/skills/outlines/references/examples.md +773 -0
- package/bin/skills/outlines/references/json_generation.md +652 -0
- package/bin/skills/peft/SKILL.md +431 -0
- package/bin/skills/peft/references/advanced-usage.md +514 -0
- package/bin/skills/peft/references/troubleshooting.md +480 -0
- package/bin/skills/phoenix/SKILL.md +475 -0
- package/bin/skills/phoenix/references/advanced-usage.md +619 -0
- package/bin/skills/phoenix/references/troubleshooting.md +538 -0
- package/bin/skills/pinecone/SKILL.md +358 -0
- package/bin/skills/pinecone/references/deployment.md +181 -0
- package/bin/skills/pytorch-fsdp/SKILL.md +126 -0
- package/bin/skills/pytorch-fsdp/references/index.md +7 -0
- package/bin/skills/pytorch-fsdp/references/other.md +4249 -0
- package/bin/skills/pytorch-lightning/SKILL.md +346 -0
- package/bin/skills/pytorch-lightning/references/callbacks.md +436 -0
- package/bin/skills/pytorch-lightning/references/distributed.md +490 -0
- package/bin/skills/pytorch-lightning/references/hyperparameter-tuning.md +556 -0
- package/bin/skills/pyvene/SKILL.md +473 -0
- package/bin/skills/pyvene/references/README.md +73 -0
- package/bin/skills/pyvene/references/api.md +383 -0
- package/bin/skills/pyvene/references/tutorials.md +376 -0
- package/bin/skills/qdrant/SKILL.md +493 -0
- package/bin/skills/qdrant/references/advanced-usage.md +648 -0
- package/bin/skills/qdrant/references/troubleshooting.md +631 -0
- package/bin/skills/ray-data/SKILL.md +326 -0
- package/bin/skills/ray-data/references/integration.md +82 -0
- package/bin/skills/ray-data/references/transformations.md +83 -0
- package/bin/skills/ray-train/SKILL.md +406 -0
- package/bin/skills/ray-train/references/multi-node.md +628 -0
- package/bin/skills/rwkv/SKILL.md +260 -0
- package/bin/skills/rwkv/references/architecture-details.md +344 -0
- package/bin/skills/rwkv/references/rwkv7.md +386 -0
- package/bin/skills/rwkv/references/state-management.md +369 -0
- package/bin/skills/saelens/SKILL.md +386 -0
- package/bin/skills/saelens/references/README.md +70 -0
- package/bin/skills/saelens/references/api.md +333 -0
- package/bin/skills/saelens/references/tutorials.md +318 -0
- package/bin/skills/segment-anything/SKILL.md +500 -0
- package/bin/skills/segment-anything/references/advanced-usage.md +589 -0
- package/bin/skills/segment-anything/references/troubleshooting.md +484 -0
- package/bin/skills/sentence-transformers/SKILL.md +255 -0
- package/bin/skills/sentence-transformers/references/models.md +123 -0
- package/bin/skills/sentencepiece/SKILL.md +235 -0
- package/bin/skills/sentencepiece/references/algorithms.md +200 -0
- package/bin/skills/sentencepiece/references/training.md +304 -0
- package/bin/skills/sglang/SKILL.md +442 -0
- package/bin/skills/sglang/references/deployment.md +490 -0
- package/bin/skills/sglang/references/radix-attention.md +413 -0
- package/bin/skills/sglang/references/structured-generation.md +541 -0
- package/bin/skills/simpo/SKILL.md +219 -0
- package/bin/skills/simpo/references/datasets.md +478 -0
- package/bin/skills/simpo/references/hyperparameters.md +452 -0
- package/bin/skills/simpo/references/loss-functions.md +350 -0
- package/bin/skills/skypilot/SKILL.md +509 -0
- package/bin/skills/skypilot/references/advanced-usage.md +491 -0
- package/bin/skills/skypilot/references/troubleshooting.md +570 -0
- package/bin/skills/slime/SKILL.md +464 -0
- package/bin/skills/slime/references/api-reference.md +392 -0
- package/bin/skills/slime/references/troubleshooting.md +386 -0
- package/bin/skills/speculative-decoding/SKILL.md +467 -0
- package/bin/skills/speculative-decoding/references/lookahead.md +309 -0
- package/bin/skills/speculative-decoding/references/medusa.md +350 -0
- package/bin/skills/stable-diffusion/SKILL.md +519 -0
- package/bin/skills/stable-diffusion/references/advanced-usage.md +716 -0
- package/bin/skills/stable-diffusion/references/troubleshooting.md +555 -0
- package/bin/skills/tensorboard/SKILL.md +629 -0
- package/bin/skills/tensorboard/references/integrations.md +638 -0
- package/bin/skills/tensorboard/references/profiling.md +545 -0
- package/bin/skills/tensorboard/references/visualization.md +620 -0
- package/bin/skills/tensorrt-llm/SKILL.md +187 -0
- package/bin/skills/tensorrt-llm/references/multi-gpu.md +298 -0
- package/bin/skills/tensorrt-llm/references/optimization.md +242 -0
- package/bin/skills/tensorrt-llm/references/serving.md +470 -0
- package/bin/skills/tinker/SKILL.md +362 -0
- package/bin/skills/tinker/references/api-reference.md +168 -0
- package/bin/skills/tinker/references/getting-started.md +157 -0
- package/bin/skills/tinker/references/loss-functions.md +163 -0
- package/bin/skills/tinker/references/models-and-lora.md +139 -0
- package/bin/skills/tinker/references/recipes.md +280 -0
- package/bin/skills/tinker/references/reinforcement-learning.md +212 -0
- package/bin/skills/tinker/references/rendering.md +243 -0
- package/bin/skills/tinker/references/supervised-learning.md +232 -0
- package/bin/skills/tinker-training-cost/SKILL.md +187 -0
- package/bin/skills/tinker-training-cost/scripts/calculate_cost.py +123 -0
- package/bin/skills/torchforge/SKILL.md +433 -0
- package/bin/skills/torchforge/references/api-reference.md +327 -0
- package/bin/skills/torchforge/references/troubleshooting.md +409 -0
- package/bin/skills/torchtitan/SKILL.md +358 -0
- package/bin/skills/torchtitan/references/checkpoint.md +181 -0
- package/bin/skills/torchtitan/references/custom-models.md +258 -0
- package/bin/skills/torchtitan/references/float8.md +133 -0
- package/bin/skills/torchtitan/references/fsdp.md +126 -0
- package/bin/skills/transformer-lens/SKILL.md +346 -0
- package/bin/skills/transformer-lens/references/README.md +54 -0
- package/bin/skills/transformer-lens/references/api.md +362 -0
- package/bin/skills/transformer-lens/references/tutorials.md +339 -0
- package/bin/skills/trl-fine-tuning/SKILL.md +455 -0
- package/bin/skills/trl-fine-tuning/references/dpo-variants.md +227 -0
- package/bin/skills/trl-fine-tuning/references/online-rl.md +82 -0
- package/bin/skills/trl-fine-tuning/references/reward-modeling.md +122 -0
- package/bin/skills/trl-fine-tuning/references/sft-training.md +168 -0
- package/bin/skills/unsloth/SKILL.md +80 -0
- package/bin/skills/unsloth/references/index.md +7 -0
- package/bin/skills/unsloth/references/llms-full.md +16799 -0
- package/bin/skills/unsloth/references/llms-txt.md +12044 -0
- package/bin/skills/unsloth/references/llms.md +82 -0
- package/bin/skills/verl/SKILL.md +391 -0
- package/bin/skills/verl/references/api-reference.md +301 -0
- package/bin/skills/verl/references/troubleshooting.md +391 -0
- package/bin/skills/vllm/SKILL.md +364 -0
- package/bin/skills/vllm/references/optimization.md +226 -0
- package/bin/skills/vllm/references/quantization.md +284 -0
- package/bin/skills/vllm/references/server-deployment.md +255 -0
- package/bin/skills/vllm/references/troubleshooting.md +447 -0
- package/bin/skills/weights-and-biases/SKILL.md +590 -0
- package/bin/skills/weights-and-biases/references/artifacts.md +584 -0
- package/bin/skills/weights-and-biases/references/integrations.md +700 -0
- package/bin/skills/weights-and-biases/references/sweeps.md +847 -0
- package/bin/skills/whisper/SKILL.md +317 -0
- package/bin/skills/whisper/references/languages.md +189 -0
- package/bin/synsc +0 -0
- package/package.json +10 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
show_help() {
|
|
6
|
+
cat << EOF
|
|
7
|
+
Ultra-simple Hugging Face API example (Shell)
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
$0 [limit]
|
|
11
|
+
$0 --help
|
|
12
|
+
|
|
13
|
+
Description:
|
|
14
|
+
Fetches a small list of models from the HF API and prints raw JSON.
|
|
15
|
+
Uses HF_TOKEN for auth if the environment variable is set.
|
|
16
|
+
|
|
17
|
+
Examples:
|
|
18
|
+
$0
|
|
19
|
+
$0 5
|
|
20
|
+
HF_TOKEN=your_token $0 10
|
|
21
|
+
EOF
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if [[ "${1:-}" == "--help" ]]; then
|
|
25
|
+
show_help
|
|
26
|
+
exit 0
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
LIMIT="${1:-3}"
|
|
30
|
+
if ! [[ "$LIMIT" =~ ^[0-9]+$ ]]; then
|
|
31
|
+
echo "Error: limit must be a number" >&2
|
|
32
|
+
exit 1
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
headers=()
|
|
36
|
+
if [[ -n "${HF_TOKEN:-}" ]]; then
|
|
37
|
+
headers=(-H "Authorization: Bearer ${HF_TOKEN}")
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
curl -s "${headers[@]}" "https://huggingface.co/api/models?limit=${LIMIT}"
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Ultra-simple Hugging Face API example (TSX).
|
|
5
|
+
*
|
|
6
|
+
* Fetches a small list of models from the HF API and prints raw JSON.
|
|
7
|
+
* Uses HF_TOKEN for auth if the environment variable is set.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const showHelp = () => {
|
|
11
|
+
console.log(`Ultra-simple Hugging Face API example (TSX)
|
|
12
|
+
|
|
13
|
+
Usage:
|
|
14
|
+
baseline_hf_api.tsx [limit]
|
|
15
|
+
baseline_hf_api.tsx --help
|
|
16
|
+
|
|
17
|
+
Description:
|
|
18
|
+
Fetches a small list of models from the HF API and prints raw JSON.
|
|
19
|
+
Uses HF_TOKEN for auth if the environment variable is set.
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
baseline_hf_api.tsx
|
|
23
|
+
baseline_hf_api.tsx 5
|
|
24
|
+
HF_TOKEN=your_token baseline_hf_api.tsx 10
|
|
25
|
+
`);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const arg = process.argv[2];
|
|
29
|
+
if (arg === "--help") {
|
|
30
|
+
showHelp();
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const limit = arg ?? "3";
|
|
35
|
+
if (!/^\d+$/.test(limit)) {
|
|
36
|
+
console.error("Error: limit must be a number");
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const token = process.env.HF_TOKEN;
|
|
41
|
+
const headers: Record<string, string> = token
|
|
42
|
+
? { Authorization: `Bearer ${token}` }
|
|
43
|
+
: {};
|
|
44
|
+
|
|
45
|
+
const url = `https://huggingface.co/api/models?limit=${limit}`;
|
|
46
|
+
|
|
47
|
+
(async () => {
|
|
48
|
+
const res = await fetch(url, { headers });
|
|
49
|
+
|
|
50
|
+
if (!res.ok) {
|
|
51
|
+
console.error(`Error: ${res.status} ${res.statusText}`);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const text = await res.text();
|
|
56
|
+
process.stdout.write(text);
|
|
57
|
+
})();
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Find models associated with papers on Hugging Face
|
|
4
|
+
# Usage: ./find_models_by_paper.sh [arXiv_id|search_term]
|
|
5
|
+
# Optional: Set HF_TOKEN environment variable for private/gated models
|
|
6
|
+
|
|
7
|
+
set -e
|
|
8
|
+
|
|
9
|
+
# Colors for output
|
|
10
|
+
RED='\033[0;31m'
|
|
11
|
+
GREEN='\033[0;32m'
|
|
12
|
+
YELLOW='\033[1;33m'
|
|
13
|
+
BLUE='\033[0;34m'
|
|
14
|
+
NC='\033[0m' # No Color
|
|
15
|
+
|
|
16
|
+
# Help function
|
|
17
|
+
show_help() {
|
|
18
|
+
echo -e "${BLUE}Find models associated with papers on Hugging Face${NC}"
|
|
19
|
+
echo ""
|
|
20
|
+
echo -e "${YELLOW}Usage:${NC}"
|
|
21
|
+
echo " $0 [OPTIONS] [search_term|arXiv_id]"
|
|
22
|
+
echo ""
|
|
23
|
+
echo -e "${YELLOW}Options:${NC}"
|
|
24
|
+
echo " --help Show this help message"
|
|
25
|
+
echo " --token Use HF_TOKEN environment variable (if set)"
|
|
26
|
+
echo ""
|
|
27
|
+
echo -e "${YELLOW}Environment:${NC}"
|
|
28
|
+
echo " HF_TOKEN Optional: Hugging Face token for private/gated models"
|
|
29
|
+
echo ""
|
|
30
|
+
echo -e "${YELLOW}Examples:${NC}"
|
|
31
|
+
echo " $0 1910.01108 # Search by arXiv ID"
|
|
32
|
+
echo " $0 distilbert # Search by model name"
|
|
33
|
+
echo " $0 transformer # Search by keyword"
|
|
34
|
+
echo " HF_TOKEN=your_token $0 1910.01108 # Use authentication"
|
|
35
|
+
echo ""
|
|
36
|
+
echo -e "${YELLOW}Description:${NC}"
|
|
37
|
+
echo "This script finds Hugging Face models that are associated with research papers."
|
|
38
|
+
echo "It searches for models that have arXiv IDs in their tags or mentions papers in their metadata."
|
|
39
|
+
echo ""
|
|
40
|
+
echo -e "${YELLOW}Notes:${NC}"
|
|
41
|
+
echo "• HF_TOKEN is optional for public models"
|
|
42
|
+
echo "• Use HF_TOKEN for private repositories or gated models"
|
|
43
|
+
echo "• HF_TOKEN enables higher rate limits for heavy usage"
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
# Parse arguments
|
|
47
|
+
USE_TOKEN=false
|
|
48
|
+
POSITIONAL_ARGS=()
|
|
49
|
+
|
|
50
|
+
while [[ $# -gt 0 ]]; do
|
|
51
|
+
case $1 in
|
|
52
|
+
--help)
|
|
53
|
+
show_help
|
|
54
|
+
exit 0
|
|
55
|
+
;;
|
|
56
|
+
--token)
|
|
57
|
+
USE_TOKEN=true
|
|
58
|
+
shift
|
|
59
|
+
;;
|
|
60
|
+
-*)
|
|
61
|
+
echo -e "${RED}Unknown option: $1${NC}"
|
|
62
|
+
show_help
|
|
63
|
+
exit 1
|
|
64
|
+
;;
|
|
65
|
+
*)
|
|
66
|
+
POSITIONAL_ARGS+=("$1")
|
|
67
|
+
shift
|
|
68
|
+
;;
|
|
69
|
+
esac
|
|
70
|
+
done
|
|
71
|
+
|
|
72
|
+
set -- "${POSITIONAL_ARGS[@]}"
|
|
73
|
+
|
|
74
|
+
if [[ $# -eq 0 ]]; then
|
|
75
|
+
echo -e "${RED}Error: Please provide a search term or arXiv ID${NC}"
|
|
76
|
+
echo -e "Use ${YELLOW}$0 --help${NC} for usage information"
|
|
77
|
+
exit 1
|
|
78
|
+
fi
|
|
79
|
+
|
|
80
|
+
SEARCH_TERM="$1"
|
|
81
|
+
|
|
82
|
+
# Set up authentication header if HF_TOKEN is available
|
|
83
|
+
if [[ -n "$HF_TOKEN" ]] && [[ "$USE_TOKEN" == true || -n "$HF_TOKEN" ]]; then
|
|
84
|
+
AUTH_HEADER="-H \"Authorization: Bearer $HF_TOKEN\""
|
|
85
|
+
echo -e "${BLUE}Using HF_TOKEN for authentication${NC}"
|
|
86
|
+
else
|
|
87
|
+
AUTH_HEADER=""
|
|
88
|
+
if [[ -n "$HF_TOKEN" ]]; then
|
|
89
|
+
echo -e "${YELLOW}HF_TOKEN found but not using it (add --token flag to use)${NC}"
|
|
90
|
+
fi
|
|
91
|
+
fi
|
|
92
|
+
|
|
93
|
+
# Check if the input looks like an arXiv ID (format: YYYY.NNNNN or YYYY.NNNNNNN)
|
|
94
|
+
if [[ "$SEARCH_TERM" =~ ^[0-9]{4}\.[0-9]{4,7}$ ]]; then
|
|
95
|
+
echo -e "${BLUE}Searching for models associated with arXiv paper: $SEARCH_TERM${NC}"
|
|
96
|
+
SEARCH_QUERY="arxiv%3A$SEARCH_TERM"
|
|
97
|
+
IS_ARXIV_SEARCH=true
|
|
98
|
+
else
|
|
99
|
+
echo -e "${BLUE}Searching for models related to: $SEARCH_TERM${NC}"
|
|
100
|
+
SEARCH_QUERY="$SEARCH_TERM"
|
|
101
|
+
IS_ARXIV_SEARCH=false
|
|
102
|
+
fi
|
|
103
|
+
|
|
104
|
+
# Function to extract arXiv IDs from tags
|
|
105
|
+
extract_arxiv_ids() {
|
|
106
|
+
local tags="$1"
|
|
107
|
+
echo "$tags" | jq -r '.[] | select(. | startswith("arxiv:")) | split(":")[1]' 2>/dev/null || true
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
# Function to get paper title from arXiv ID
|
|
111
|
+
get_paper_title() {
|
|
112
|
+
local arxiv_id="$1"
|
|
113
|
+
# Try to get paper title from Hugging Face tags if available
|
|
114
|
+
# This is a simplified approach - in practice, you might want to call arXiv API
|
|
115
|
+
echo "Paper Title (arXiv:$arxiv_id)"
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
# Search for models
|
|
119
|
+
API_URL="https://huggingface.co/api/models"
|
|
120
|
+
echo -e "${YELLOW}Searching Hugging Face API...${NC}"
|
|
121
|
+
|
|
122
|
+
# Build curl command with authentication if available
|
|
123
|
+
CURL_CMD="curl -s $AUTH_HEADER \"$API_URL?search=$SEARCH_QUERY&limit=50\""
|
|
124
|
+
echo -e "${BLUE}API Query: $API_URL?search=$SEARCH_QUERY&limit=50${NC}"
|
|
125
|
+
|
|
126
|
+
# Execute the API call
|
|
127
|
+
if [[ -n "$HF_TOKEN" ]]; then
|
|
128
|
+
RESPONSE=$(curl -s -H "Authorization: Bearer $HF_TOKEN" "$API_URL?search=$SEARCH_QUERY&limit=50" || true)
|
|
129
|
+
else
|
|
130
|
+
RESPONSE=$(curl -s "$API_URL?search=$SEARCH_QUERY&limit=50" || true)
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
# Check if we got a valid response
|
|
134
|
+
if [[ -z "$RESPONSE" ]] || [[ "$RESPONSE" == "[]" ]]; then
|
|
135
|
+
echo -e "${RED}No models found for search term: $SEARCH_TERM${NC}"
|
|
136
|
+
|
|
137
|
+
# If arXiv search failed, try without arxiv: prefix
|
|
138
|
+
if [[ "$IS_ARXIV_SEARCH" == true ]]; then
|
|
139
|
+
echo -e "${YELLOW}Trying broader search without arxiv: prefix...${NC}"
|
|
140
|
+
SEARCH_QUERY="$SEARCH_TERM"
|
|
141
|
+
IS_ARXIV_SEARCH=false
|
|
142
|
+
|
|
143
|
+
if [[ -n "$HF_TOKEN" ]]; then
|
|
144
|
+
RESPONSE=$(curl -s -H "Authorization: Bearer $HF_TOKEN" "$API_URL?search=$SEARCH_QUERY&limit=50" || true)
|
|
145
|
+
else
|
|
146
|
+
RESPONSE=$(curl -s "$API_URL?search=$SEARCH_QUERY&limit=50" || true)
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
if [[ -z "$RESPONSE" ]] || [[ "$RESPONSE" == "[]" ]]; then
|
|
150
|
+
echo -e "${RED}Still no results found. Try a different search term.${NC}"
|
|
151
|
+
exit 1
|
|
152
|
+
fi
|
|
153
|
+
else
|
|
154
|
+
exit 1
|
|
155
|
+
fi
|
|
156
|
+
fi
|
|
157
|
+
|
|
158
|
+
# Process the results
|
|
159
|
+
echo -e "${GREEN}Found models! Processing results...${NC}"
|
|
160
|
+
|
|
161
|
+
# Use jq to process the JSON response and find models with paper associations
|
|
162
|
+
MODELS_WITH_PAPERS=$(echo "$RESPONSE" | jq -r '
|
|
163
|
+
.[] |
|
|
164
|
+
select(.id != null) |
|
|
165
|
+
{
|
|
166
|
+
id: .id,
|
|
167
|
+
arxiv_tags: [.tags[] | select(. | startswith("arxiv:"))] | join("; "),
|
|
168
|
+
downloads: (.downloads // 0),
|
|
169
|
+
likes: (.likes // 0),
|
|
170
|
+
task: (.pipeline_tag // "unknown"),
|
|
171
|
+
library: (.library_name // "unknown")
|
|
172
|
+
}
|
|
173
|
+
| @base64' 2>/dev/null || true)
|
|
174
|
+
|
|
175
|
+
# Count total results
|
|
176
|
+
TOTAL_MODELS=$(echo "$RESPONSE" | jq 'length' 2>/dev/null || echo "0")
|
|
177
|
+
MODELS_WITH_PAPERS_COUNT=$(echo "$MODELS_WITH_PAPERS" | wc -l)
|
|
178
|
+
|
|
179
|
+
echo -e "${BLUE}Results Summary:${NC}"
|
|
180
|
+
echo -e " Total models found: $TOTAL_MODELS"
|
|
181
|
+
echo -e " Models with paper associations: $MODELS_WITH_PAPERS_COUNT"
|
|
182
|
+
echo ""
|
|
183
|
+
|
|
184
|
+
if [[ -z "$MODELS_WITH_PAPERS" ]]; then
|
|
185
|
+
# Show all models even if no paper associations found
|
|
186
|
+
echo -e "${YELLOW}No explicit paper associations found. Showing all matching models:${NC}"
|
|
187
|
+
echo "$RESPONSE" | jq -r '
|
|
188
|
+
.[] |
|
|
189
|
+
select(.id != null) |
|
|
190
|
+
"📦 \(.id)
|
|
191
|
+
Task: \(.pipeline_tag // "unknown")
|
|
192
|
+
Downloads: \(.downloads // 0)
|
|
193
|
+
Likes: \(.likes // 0)
|
|
194
|
+
Library: \(.library_name // "unknown")
|
|
195
|
+
---"
|
|
196
|
+
' 2>/dev/null || echo "Failed to parse response"
|
|
197
|
+
else
|
|
198
|
+
# Show models with paper associations
|
|
199
|
+
echo -e "${GREEN}Models with paper associations:${NC}"
|
|
200
|
+
echo "$MODELS_WITH_PAPERS" | while read -r model_data; do
|
|
201
|
+
if [[ -n "$model_data" ]]; then
|
|
202
|
+
# Decode base64 and show formatted
|
|
203
|
+
echo "$model_data" | base64 -d | jq -r '
|
|
204
|
+
"📄 \(.id)
|
|
205
|
+
arXiv: \(.arxiv_tags)
|
|
206
|
+
Task: \(.task)
|
|
207
|
+
Downloads: \(.downloads)
|
|
208
|
+
Likes: \(.likes)
|
|
209
|
+
Library: \(.library)
|
|
210
|
+
---"
|
|
211
|
+
' 2>/dev/null || echo "Failed to parse model data"
|
|
212
|
+
fi
|
|
213
|
+
done
|
|
214
|
+
fi
|
|
215
|
+
|
|
216
|
+
# Additional search tips
|
|
217
|
+
echo ""
|
|
218
|
+
echo -e "${BLUE}Search Tips:${NC}"
|
|
219
|
+
echo "• Try searching with the full arXiv ID (e.g., 1910.01108)"
|
|
220
|
+
echo "• Try searching with the paper title keywords"
|
|
221
|
+
echo "• Try searching with the model name"
|
|
222
|
+
echo "• Use HF_TOKEN for private models or higher rate limits"
|
|
223
|
+
echo ""
|
|
224
|
+
echo -e "${BLUE}Examples to try:${NC}"
|
|
225
|
+
echo " $0 1910.01108 # DistilBERT paper"
|
|
226
|
+
echo " $0 1810.04805 # BERT paper"
|
|
227
|
+
echo " $0 1706.03762 # Attention is All You Need paper"
|
|
228
|
+
echo " $0 roberta # RoBERTa models"
|
|
229
|
+
echo " $0 transformer # Transformer models"
|
|
230
|
+
echo " HF_TOKEN=your_token $0 1910.01108 # Use authentication"
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
show_help() {
|
|
6
|
+
cat << 'USAGE'
|
|
7
|
+
Stream model IDs on stdin, emit one JSON object per line (NDJSON).
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
hf_enrich_models.sh [MODEL_ID ...]
|
|
11
|
+
cat ids.txt | hf_enrich_models.sh
|
|
12
|
+
baseline_hf_api.sh 50 | jq -r '.[].id' | hf_enrich_models.sh
|
|
13
|
+
|
|
14
|
+
Description:
|
|
15
|
+
Reads newline-separated model IDs and fetches basic metadata for each.
|
|
16
|
+
Outputs NDJSON with id, downloads, likes, pipeline_tag, tags.
|
|
17
|
+
Uses HF_TOKEN for auth if the environment variable is set.
|
|
18
|
+
|
|
19
|
+
Examples:
|
|
20
|
+
hf_enrich_models.sh gpt2 distilbert-base-uncased
|
|
21
|
+
baseline_hf_api.sh 50 | jq -r '.[].id' | hf_enrich_models.sh | jq -s 'sort_by(.downloads)'
|
|
22
|
+
HF_TOKEN=your_token hf_enrich_models.sh microsoft/DialoGPT-medium
|
|
23
|
+
USAGE
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if [[ "${1:-}" == "--help" ]]; then
|
|
27
|
+
show_help
|
|
28
|
+
exit 0
|
|
29
|
+
fi
|
|
30
|
+
|
|
31
|
+
if ! command -v jq >/dev/null 2>&1; then
|
|
32
|
+
echo "Error: jq is required but not installed" >&2
|
|
33
|
+
exit 1
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
headers=()
|
|
37
|
+
if [[ -n "${HF_TOKEN:-}" ]]; then
|
|
38
|
+
headers=(-H "Authorization: Bearer ${HF_TOKEN}")
|
|
39
|
+
fi
|
|
40
|
+
|
|
41
|
+
emit_error() {
|
|
42
|
+
local model_id="$1"
|
|
43
|
+
local message="$2"
|
|
44
|
+
jq -cn --arg id "$model_id" --arg error "$message" '{id: $id, error: $error}'
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
process_id() {
|
|
48
|
+
local model_id="$1"
|
|
49
|
+
|
|
50
|
+
if [[ -z "$model_id" ]]; then
|
|
51
|
+
return 0
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
local url="https://huggingface.co/api/models/${model_id}"
|
|
55
|
+
local response
|
|
56
|
+
response=$(curl -s "${headers[@]}" "$url" 2>/dev/null || true)
|
|
57
|
+
|
|
58
|
+
if [[ -z "$response" ]]; then
|
|
59
|
+
emit_error "$model_id" "request_failed"
|
|
60
|
+
return 0
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
if ! jq -e . >/dev/null 2>&1 <<<"$response"; then
|
|
64
|
+
emit_error "$model_id" "invalid_json"
|
|
65
|
+
return 0
|
|
66
|
+
fi
|
|
67
|
+
|
|
68
|
+
if jq -e '.error' >/dev/null 2>&1 <<<"$response"; then
|
|
69
|
+
emit_error "$model_id" "not_found"
|
|
70
|
+
return 0
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
jq -c --arg id "$model_id" '{
|
|
74
|
+
id: (.id // $id),
|
|
75
|
+
downloads: (.downloads // 0),
|
|
76
|
+
likes: (.likes // 0),
|
|
77
|
+
pipeline_tag: (.pipeline_tag // "unknown"),
|
|
78
|
+
tags: (.tags // [])
|
|
79
|
+
}' <<<"$response" 2>/dev/null || emit_error "$model_id" "parse_failed"
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if [[ $# -gt 0 ]]; then
|
|
83
|
+
for model_id in "$@"; do
|
|
84
|
+
process_id "$model_id"
|
|
85
|
+
done
|
|
86
|
+
exit 0
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
if [[ -t 0 ]]; then
|
|
90
|
+
show_help
|
|
91
|
+
exit 1
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
while IFS= read -r model_id; do
|
|
95
|
+
process_id "$model_id"
|
|
96
|
+
done
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
show_help() {
|
|
6
|
+
cat << 'USAGE'
|
|
7
|
+
Fetch Hugging Face model cards via the hf CLI and summarize frontmatter.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
hf_model_card_frontmatter.sh [MODEL_ID ...]
|
|
11
|
+
cat ids.txt | hf_model_card_frontmatter.sh
|
|
12
|
+
|
|
13
|
+
Description:
|
|
14
|
+
Downloads README.md for each model via `hf download`, extracts YAML
|
|
15
|
+
frontmatter, and emits one JSON object per line (NDJSON) with key fields.
|
|
16
|
+
Uses HF_TOKEN if set (passed to the hf CLI).
|
|
17
|
+
|
|
18
|
+
Output fields:
|
|
19
|
+
id, license, pipeline_tag, library_name, tags, language,
|
|
20
|
+
new_version, has_extra_gated_prompt
|
|
21
|
+
|
|
22
|
+
Examples:
|
|
23
|
+
hf_model_card_frontmatter.sh openai/gpt-oss-120b
|
|
24
|
+
cat ids.txt | hf_model_card_frontmatter.sh | jq -s '.'
|
|
25
|
+
hf_model_card_frontmatter.sh meta-llama/Meta-Llama-3-8B \
|
|
26
|
+
| jq -s 'map({id, license, has_extra_gated_prompt})'
|
|
27
|
+
USAGE
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if [[ "${1:-}" == "--help" ]]; then
|
|
31
|
+
show_help
|
|
32
|
+
exit 0
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
if ! command -v hf >/dev/null 2>&1; then
|
|
36
|
+
echo "Error: hf CLI is required but not installed" >&2
|
|
37
|
+
exit 1
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
if ! command -v python3 >/dev/null 2>&1; then
|
|
41
|
+
echo "Error: python3 is required but not installed" >&2
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
token_args=()
|
|
46
|
+
if [[ -n "${HF_TOKEN:-}" ]]; then
|
|
47
|
+
token_args=(--token "$HF_TOKEN")
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
tmp_dir=$(mktemp -d)
|
|
51
|
+
cleanup() {
|
|
52
|
+
rm -rf "$tmp_dir"
|
|
53
|
+
}
|
|
54
|
+
trap cleanup EXIT
|
|
55
|
+
|
|
56
|
+
emit_error() {
|
|
57
|
+
local model_id="$1"
|
|
58
|
+
local message="$2"
|
|
59
|
+
python3 - << 'PY' "$model_id" "$message"
|
|
60
|
+
import json
|
|
61
|
+
import sys
|
|
62
|
+
|
|
63
|
+
model_id = sys.argv[1]
|
|
64
|
+
message = sys.argv[2]
|
|
65
|
+
print(json.dumps({"id": model_id, "error": message}))
|
|
66
|
+
PY
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
parse_readme() {
|
|
70
|
+
local model_id="$1"
|
|
71
|
+
local readme_path="$2"
|
|
72
|
+
|
|
73
|
+
MODEL_ID="$model_id" README_PATH="$readme_path" python3 - << 'PY'
|
|
74
|
+
import json
|
|
75
|
+
import os
|
|
76
|
+
import sys
|
|
77
|
+
|
|
78
|
+
model_id = os.environ.get("MODEL_ID", "")
|
|
79
|
+
readme_path = os.environ.get("README_PATH", "")
|
|
80
|
+
|
|
81
|
+
try:
|
|
82
|
+
with open(readme_path, "r", encoding="utf-8") as f:
|
|
83
|
+
lines = f.read().splitlines()
|
|
84
|
+
except OSError:
|
|
85
|
+
print(json.dumps({"id": model_id, "error": "readme_missing"}))
|
|
86
|
+
sys.exit(0)
|
|
87
|
+
|
|
88
|
+
frontmatter = []
|
|
89
|
+
in_block = False
|
|
90
|
+
for line in lines:
|
|
91
|
+
if line.strip() == "---":
|
|
92
|
+
if in_block:
|
|
93
|
+
break
|
|
94
|
+
in_block = True
|
|
95
|
+
continue
|
|
96
|
+
if in_block:
|
|
97
|
+
frontmatter.append(line)
|
|
98
|
+
|
|
99
|
+
if not frontmatter:
|
|
100
|
+
print(json.dumps({"id": model_id, "error": "frontmatter_missing"}))
|
|
101
|
+
sys.exit(0)
|
|
102
|
+
|
|
103
|
+
key = None
|
|
104
|
+
out = {}
|
|
105
|
+
|
|
106
|
+
for line in frontmatter:
|
|
107
|
+
stripped = line.strip()
|
|
108
|
+
if not stripped or line.lstrip().startswith("#"):
|
|
109
|
+
continue
|
|
110
|
+
|
|
111
|
+
if ":" in line and not line.lstrip().startswith("- "):
|
|
112
|
+
key_candidate, value = line.split(":", 1)
|
|
113
|
+
key_candidate = key_candidate.strip()
|
|
114
|
+
value = value.strip()
|
|
115
|
+
if key_candidate and all(c.isalnum() or c in "_-" for c in key_candidate):
|
|
116
|
+
key = key_candidate
|
|
117
|
+
if value in ("|", "|-", ">", ">-") or value == "":
|
|
118
|
+
out[key] = None
|
|
119
|
+
continue
|
|
120
|
+
if value.startswith("[") and value.endswith("]"):
|
|
121
|
+
items = [v.strip() for v in value.strip("[]").split(",") if v.strip()]
|
|
122
|
+
out[key] = items
|
|
123
|
+
else:
|
|
124
|
+
out[key] = value
|
|
125
|
+
continue
|
|
126
|
+
|
|
127
|
+
if line.lstrip().startswith("- ") and key:
|
|
128
|
+
item = line.strip()[2:]
|
|
129
|
+
if key not in out or out[key] is None:
|
|
130
|
+
out[key] = []
|
|
131
|
+
if isinstance(out[key], list):
|
|
132
|
+
out[key].append(item)
|
|
133
|
+
|
|
134
|
+
result = {
|
|
135
|
+
"id": model_id,
|
|
136
|
+
"license": out.get("license"),
|
|
137
|
+
"pipeline_tag": out.get("pipeline_tag"),
|
|
138
|
+
"library_name": out.get("library_name"),
|
|
139
|
+
"tags": out.get("tags", []),
|
|
140
|
+
"language": out.get("language", []),
|
|
141
|
+
"new_version": out.get("new_version"),
|
|
142
|
+
"has_extra_gated_prompt": "extra_gated_prompt" in out,
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
print(json.dumps(result))
|
|
146
|
+
PY
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
process_id() {
|
|
150
|
+
local model_id="$1"
|
|
151
|
+
|
|
152
|
+
if [[ -z "$model_id" ]]; then
|
|
153
|
+
return 0
|
|
154
|
+
fi
|
|
155
|
+
|
|
156
|
+
local safe_id
|
|
157
|
+
safe_id=$(printf '%s' "$model_id" | tr '/' '_')
|
|
158
|
+
local local_dir="$tmp_dir/$safe_id"
|
|
159
|
+
|
|
160
|
+
if ! hf download "$model_id" README.md --repo-type model --local-dir "$local_dir" "${token_args[@]}" >/dev/null 2>&1; then
|
|
161
|
+
emit_error "$model_id" "download_failed"
|
|
162
|
+
return 0
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
local readme_path="$local_dir/README.md"
|
|
166
|
+
if [[ ! -f "$readme_path" ]]; then
|
|
167
|
+
emit_error "$model_id" "readme_missing"
|
|
168
|
+
return 0
|
|
169
|
+
fi
|
|
170
|
+
|
|
171
|
+
parse_readme "$model_id" "$readme_path"
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if [[ $# -gt 0 ]]; then
|
|
175
|
+
for model_id in "$@"; do
|
|
176
|
+
process_id "$model_id"
|
|
177
|
+
done
|
|
178
|
+
exit 0
|
|
179
|
+
fi
|
|
180
|
+
|
|
181
|
+
if [[ -t 0 ]]; then
|
|
182
|
+
show_help
|
|
183
|
+
exit 1
|
|
184
|
+
fi
|
|
185
|
+
|
|
186
|
+
while IFS= read -r model_id; do
|
|
187
|
+
process_id "$model_id"
|
|
188
|
+
done
|