[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-CodeWithKyrian--transformers-php":3,"tool-CodeWithKyrian--transformers-php":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":77,"owner_avatar_url":78,"owner_bio":79,"owner_company":80,"owner_location":81,"owner_email":82,"owner_twitter":76,"owner_website":79,"owner_url":83,"languages":84,"stars":101,"forks":102,"last_commit_at":103,"license":104,"difficulty_score":23,"env_os":105,"env_gpu":106,"env_ram":107,"env_deps":108,"category_tags":118,"github_topics":119,"view_count":23,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":124,"updated_at":125,"faqs":126,"releases":154},2443,"CodeWithKyrian\u002Ftransformers-php","transformers-php","Transformers PHP is a toolkit for PHP developers to add machine learning magic to their projects easily. ","TransformersPHP 是一款专为 PHP 开发者打造的机器学习工具包，旨在让在 PHP 项目中集成先进的人工智能功能变得简单高效。它填补了 PHP 生态在原生支持大型预训练模型方面的空白，解决了开发者以往必须依赖外部 Python 服务或复杂 API 调用才能实现文本生成、摘要、翻译及情感分析等 AI 任务的痛点。\n\n这款工具非常适合熟悉 PHP 语言的后端开发者使用，尤其是那些希望在现有 Laravel 或 Symfony 等 PHP 应用中直接嵌入智能化功能，而不愿维护额外 Python 微服务架构的技术团队。对于希望快速原型验证或构建轻量级 AI 应用的工程师而言，TransformersPHP 提供了极低的上手门槛。\n\n在技术实现上，TransformersPHP 的核心亮点在于其与 Python 版 Hugging Face Transformers 库高度一致的 API 设计。这意味着开发者可以无缝迁移现有的 Python 代码逻辑，学习成本极低。底层方面，它基于高性能的 ONNX Runtime 引擎运行，支持将 PyTorch 或 TensorFlow 模型转","TransformersPHP 是一款专为 PHP 开发者打造的机器学习工具包，旨在让在 PHP 项目中集成先进的人工智能功能变得简单高效。它填补了 PHP 生态在原生支持大型预训练模型方面的空白，解决了开发者以往必须依赖外部 Python 服务或复杂 API 调用才能实现文本生成、摘要、翻译及情感分析等 AI 任务的痛点。\n\n这款工具非常适合熟悉 PHP 语言的后端开发者使用，尤其是那些希望在现有 Laravel 或 Symfony 等 PHP 应用中直接嵌入智能化功能，而不愿维护额外 Python 微服务架构的技术团队。对于希望快速原型验证或构建轻量级 AI 应用的工程师而言，TransformersPHP 提供了极低的上手门槛。\n\n在技术实现上，TransformersPHP 的核心亮点在于其与 Python 版 Hugging Face Transformers 库高度一致的 API 设计。这意味着开发者可以无缝迁移现有的 Python 代码逻辑，学习成本极低。底层方面，它基于高性能的 ONNX Runtime 引擎运行，支持将 PyTorch 或 TensorFlow 模型转换为 ONNX 格式，从而在保证推理速度的同时，兼容 Hugging Face 平台上数千种涵盖 100 多种语言的预训练模型。通过简洁的 `pipeline` 接口，开发者只需几行代码即可调用复杂的深度学习模型，真正实现了“开箱即用”的便捷体验，让 PHP 开发者也能轻松为项目增添强大的 AI 能力。","\u003Ch1 align=\"center\">\n   TransformersPHP\n\u003C\u002Fh1>\n\n\u003Ch3 align=\"center\">\n    \u003Cp>State-of-the-art Machine Learning for PHP\u003C\u002Fp>\n\u003C\u002Fh3>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fcodewithkyrian\u002Ftransformers\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fdt\u002Fcodewithkyrian\u002Ftransformers\" alt=\"Total Downloads\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fcodewithkyrian\u002Ftransformers\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fv\u002Fcodewithkyrian\u002Ftransformers\" alt=\"Latest Stable Version\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fblob\u002Fmain\u002FLICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fcodewithkyrian\u002Ftransformers-php\" alt=\"License\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcodewithkyrian\u002Ftransformers-php\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Frepo-size\u002Fcodewithkyrian\u002Ftransformers-php\" alt=\"Documentation\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Factions\u002Fworkflows\u002Ftests.yml\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Factions\u002Fworkflows\u002Ftests.yml\u002Fbadge.svg\" alt=\"Tests\">\u003C\u002Fa>\n\u003C\u002Fp>\n\nTransformersPHP is designed to be functionally equivalent to the Python library, while still maintaining the same level of performance and ease of use. This library is built on top of the Hugging Face's Transformers library, which provides thousands of pre-trained models in 100+ languages. It is designed to be a simple and easy-to-use library for PHP developers using a similar API to the Python library. These models can be used for a variety of tasks, including text generation, summarization, translation, and more.\n\nTransformersPHP uses [ONNX Runtime](https:\u002F\u002Fonnxruntime.ai\u002F) to run the models, which is a high-performance scoring engine for Open Neural Network Exchange (ONNX) models. You can easily convert any PyTorch or TensorFlow model to ONNX and use it with TransformersPHP using [🤗 Optimum](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Foptimum#onnx--onnx-runtime).\n\nTO learn more about the library and how it works, head over to our [extensive documentation](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fintroduction).\n\n## Quick tour\n\nBecause TransformersPHP is designed to be functionally equivalent to the Python library, it's super easy to learn from existing Python or Javascript code. We provide the `pipeline` API, which is a high-level, easy-to-use API that groups together a model with its necessary preprocessing and postprocessing steps.\n\n\u003Ctable>\n\u003Ctr>\n\n\u003Cth align=\"center\">\u003Cb>Python (original)\u003C\u002Fb>\u003C\u002Fth>\n\u003Cth align=\"center\">\u003Cb>PHP (ours)\u003C\u002Fb>\u003C\u002Fth>\n\u003Cth align=\"center\">\u003Cb>Javascript (Xenova)\u003C\u002Fb>\u003C\u002Fth>\n\n\u003C\u002Ftr>\n\n\u003Ctr>\n\u003Ctd>\n\n```python\nfrom transformers import pipeline\n\n# Allocate a pipeline for sentiment-analysis\npipe = pipeline('sentiment-analysis')\n\nout = pipe('I love transformers!')\n# [{'label': 'POSITIVE', 'score': 0.999806941}]\n```\n\n\u003C\u002Ftd>\n\u003Ctd>\n\n```php\nuse function Codewithkyrian\\Transformers\\Pipelines\\pipeline;\n\n\u002F\u002F Allocate a pipeline for sentiment-analysis\n$pipe = pipeline('sentiment-analysis');\n\n$out = $pipe('I love transformers!');\n\u002F\u002F [{'label': 'POSITIVE', 'score': 0.999808732}]\n```\n\n\u003C\u002Ftd>\n\u003Ctd>\n\n```javascript\nimport {pipeline} from '@xenova\u002Ftransformers';\n\n\u002F\u002F Allocate a pipeline for sentiment-analysis\nlet pipe = await pipeline('sentiment-analysis');\n\nlet out = await pipe('I love transformers!');\n\u002F\u002F [{'label': 'POSITIVE', 'score': 0.999817686}]\n```\n\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\nYou can also use a different model by specifying the model id or path as the second argument to the `pipeline` function.\nFor example:\n\n```php\nuse function Codewithkyrian\\Transformers\\Pipelines\\pipeline;\n\n\u002F\u002F Allocate a pipeline for translation\n$pipe = pipeline('translation', 'Xenova\u002Fdistilbert-base-uncased-finetuned-sst-2-english');\n\n```\n\n## Installation\n\nYou can install the library via Composer. This is the recommended way to install the library.\n\n```bash\ncomposer require codewithkyrian\u002Ftransformers\n```\n\n> [!CAUTION]\n> The ONNX library is platform-specific, so it's important to run the composer require command on the target platform where the code will be executed. In most cases, this will be your development machine or a server where you deploy your application, but if you're using a Docker container, run the `composer require` command inside that container.\n\n## PHP FFI Extension\n\nTransformersPHP uses the PHP FFI extension to interact with the ONNX runtime. The FFI extension is included by default in PHP 7.4 and later, but it may not be enabled by default. If the FFI extension is not enabled, you can enable it by uncommenting(remove the `;` from the beginning of the line) the\nfollowing line in your `php.ini` file:\n\n```ini\nextension = ffi\n```\n\nAlso, you need to set the `ffi.enable` directive to `true` in your `php.ini` file:\n\n```ini\nffi.enable = true\n```\n\nAfter making these changes, restart your web server or PHP-FPM service, and you should be good to go.\n\n## Documentation\n\nFor more detailed information on how to use the library, check out the documentation : [https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php)\n\n## Usage\n\nBy default, TransformersPHP uses hosted pretrained ONNX models. For supported tasks, models that have been converted to work with [Xenova's Transformers.js](https:\u002F\u002Fhuggingface.co\u002Fmodels?library=transformers.js) on HuggingFace should work out of the box with TransformersPHP.\n\n## Configuration\n\nYou can configure the behaviour of the TransformersPHP library as follows:\n\n```php\nuse Codewithkyrian\\Transformers\\Transformers;\n\nTransformers::setup()\n    ->setCacheDir('...') \u002F\u002F Set the default cache directory for transformers models. Defaults to `.transformers-cache\u002Fmodels`\n    ->setRemoteHost('...') \u002F\u002F Set the remote host for downloading models. Defaults to `https:\u002F\u002Fhuggingface.co`\n    ->setRemotePathTemplate('...') \u002F\u002F Set the remote path template for downloading models. Defaults to `{model}\u002Fresolve\u002F{revision}\u002F{file}`\n    ->setAuthToken('...') \u002F\u002F Set the auth token for downloading models. Defaults to `null`\n    ->setUserAgent('...') \u002F\u002F Set the user agent for downloading models. Defaults to `transformers-php\u002F{version}`\n    ->setImageDriver('...') \u002F\u002F Set the image driver for processing images. Defaults to `VIPS`\n    ->setLogger($logger) \u002F\u002F Set a PSR-3 compatible logger. Defaults to `NullLogger` if not set\n    ->apply(); \u002F\u002F Apply the configuration\n```\n\nYou can call the `set` methods in any order, or leave any out entirely, in which case, it uses the default values. For more information on the configuration options and what they mean, checkout\nthe [documentation](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fconfiguration).\n\n## Convert your models to ONNX\n\nTransformersPHP only works with ONNX models, therefore, you must convert your PyTorch, TensorFlow or JAX models to ONNX. We recommend using the [conversion script](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftransformers.js\u002Fblob\u002Fmain\u002Fscripts\u002Fconvert.py) from Transformers.js, which uses the  [🤗 Optimum](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Foptimum) behind the scenes to perform the conversion and quantization of your model.\n\n```\npython -m convert --quantize --model_id \u003Cmodel_name_or_path>\n```\n\n## Pre-Download Models\n\nBy default, TransformersPHP automatically retrieves model weights (ONNX format) from the Hugging Face model hub when you first use a pipeline or pretrained model. This can lead to a slight delay during the initial use. To improve the user experience, it's recommended to pre-download the models you intend to use before running them in your PHP application, especially for larger models. One way to do that is run the request once manually, but TransformersPHP also comes with a command line tool to help you do just that:\n\n```bash\n.\u002Fvendor\u002Fbin\u002Ftransformers download \u003Cmodel_identifier> [\u003Ctask>] [options]\n```\n\nExplanation of Arguments:\n\n- **\u003Cmodel_identifier>**: This specifies the model you want to download. You can find model identifiers by browsing the\n  Hugging Face model hub (https:\u002F\u002Fhuggingface.co\u002Fmodels?library=transformers.js).\n- **[\\\u003Ctask\\>]**: (Optional) This parameter allows for downloading task-specific configurations and weights. This can be\n  helpful if you know the specific task you'll be using the model for (e.g., \"text2text-generation\").\n- **[options]**: (Optional) You can further customize the download process with additional options:\n    - **--cache_dir=\\\u003Cdirectory\\>**: Specify a directory to store downloaded models (defaults to the configured cache).\n      You can\n      use -c as a shortcut in the command.\n    - **--quantized=\\\u003Ctrue|false\\>**: Download the quantized model version if available (defaults to true). Quantized\n      models are\n      smaller and faster, but may have slightly lower accuracy. Use -q as a shortcut in the command.\n\n> [!CAUTION]\n> Remember to add your cache directory to your `.gitignore` file to avoid committing the downloaded models to your git\n> repository.\n\n## Supported tasks\u002Fmodels\n\nThis package is a WIP, but here's a list of tasks and architectures currently tested and supported by TransformersPHP.\n\n### Tasks\n\n#### Natural Language Processing\n\n| Task                                                                                                   | ID                                            | Description                                                                                    | Supported? |\n|--------------------------------------------------------------------------------------------------------|-----------------------------------------------|------------------------------------------------------------------------------------------------|------------|\n| [Fill-Mask](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ffill-mask)                               | `fill-mask`                                   | Masking some of the words in a sentence and predicting which words should replace those masks. | ✅          |\n| [Question Answering](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fquestion-answering)             | `question-answering`                          | Retrieve the answer to a question from a given text.                                           | ✅          |\n| [Sentence Similarity](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fsentence-similarity)           | `sentence-similarity`                         | Determining how similar two texts are.                                                         | ✅          |\n| [Summarization](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fsummarization)                       | `summarization`                               | Producing a shorter version of a document while preserving its important information.          | ✅          |\n| [Table Question Answering](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Ftable-question-answering)                      | `table-question-answering`                    | Answering a question about information from a given table.                                     | ❌          |\n| [Text Classification](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ftext-classification)           | `text-classification` or `sentiment-analysis` | Assigning a label or class to a given text.                                                    | ✅          |\n| [Text Generation](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ftext-generation)                   | `text-generation`                             | Producing new text by predicting the next word in a sequence.                                  | ✅          |\n| [Text-to-text Generation](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ftext-to-text-generation)   | `text2text-generation`                        | Converting one text sequence into another text sequence.                                       | ✅          |\n| [Token Classification](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ftoken-classification)         | `token-classification` or `ner`               | Assigning a label to each token in a text.                                                     | ✅          |\n| [Translation](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ftranslation)                           | `translation`                                 | Converting text from one language to another.                                                  | ✅          |\n| [Zero-Shot Classification](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fzero-shot-classification) | `zero-shot-classification`                    | Classifying text into classes that are unseen during training.                                 | ✅          |\n\n#### Vision\n\n| Task                                                                                           | ID                     | Description                                                                                                                                                                             | Supported? |\n|------------------------------------------------------------------------------------------------|------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|\n| [Depth Estimation](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fdepth-estimation)         | `depth-estimation`     | Predicting the depth of objects present in an image.                                                                                                                                    | ❌          |\n| [Image Classification](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fimage-classification) | `image-classification` | Assigning a label or class to an entire image.                                                                                                                                          | ✅          |\n| [Image Segmentation](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fimage-segmentation)     | `image-segmentation`   | Divides an image into segments where each pixel is mapped to an object. This task has multiple variants such as instance segmentation, panoptic segmentation and semantic segmentation. | ❌          |\n| [Image-to-Image](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fimage-to-image)             | `image-to-image`       | Transforming a source image to match the characteristics of a target image or a target image domain.                                                                                    | ✅          |\n| [Mask Generation](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fmask-generation)           | `mask-generation`      | Generate masks for the objects in an image.                                                                                                                                             | ❌          |\n| [Object Detection](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fobject-detection)         | `object-detection`     | Identify objects of certain defined classes within an image.                                                                                                                            | ✅          |\n\n#### Audio\n\n| Task                                                                                      | ID                                  | Description                                          | Supported? |\n|-------------------------------------------------------------------------------------------|-------------------------------------|------------------------------------------------------|------------|\n| [Audio Classification](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Faudio-classification)                 | `audio-classification`              | Assigning a label or class to a given audio.         | ❌          |\n| [Audio-to-Audio](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Faudio-to-audio)                             | N\u002FA                                 | Generating audio from an input audio source.         | ❌          |\n| [Automatic Speech Recognition](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Fautomatic-speech-recognition) | `automatic-speech-recognition`      | Transcribing a given audio into text.                | ❌          |\n| [Text-to-Speech](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Ftext-to-speech)                             | `text-to-speech` or `text-to-audio` | Generating natural-sounding speech given text input. | ❌          |\n\n#### Tabular\n\n| Task                                                                          | ID  | Description                                                         | Supported? |\n|-------------------------------------------------------------------------------|-----|---------------------------------------------------------------------|------------|\n| [Tabular Classification](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Ftabular-classification) | N\u002FA | Classifying a target category (a group) based on set of attributes. | ❌          |\n| [Tabular Regression](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Ftabular-regression)         | N\u002FA | Predicting a numerical value given a set of attributes.             | ❌          |\n\n#### Multimodal\n\n| Task                                                                                                                                      | ID                               | Description                                                                                                                   | Supported? |\n|-------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------|-------------------------------------------------------------------------------------------------------------------------------|------------|\n| [Document Question Answering](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Fdocument-question-answering)                                                   | `document-question-answering`    | Answering questions on document images.                                                                                       | ❌          |\n| [Feature Extraction](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ffeature-extraction)                                                | `feature-extraction`             | Transforming raw data into numerical features that can be processed while preserving the information in the original dataset. | ✅          |\n| [Image Feature Extraction](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fimage-feature-extraction)                                    | `image-feature-extraction`       | Extracting features from images.                                                                                              | ✅          |\n| [Image-to-Text](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fimage-to-text)                                                          | `image-to-text`                  | Output text from a given image.                                                                                               | ✅          |\n| [Text-to-Image](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Ftext-to-image)                                                                               | `text-to-image`                  | Generates images from input text.                                                                                             | ❌          |\n| [Visual Question Answering](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Fvisual-question-answering)                                                       | `visual-question-answering`      | Answering open-ended questions based on an image.                                                                             | ❌          |\n| [Zero-Shot Audio Classification](https:\u002F\u002Fhuggingface.co\u002Flearn\u002Faudio-course\u002Fchapter4\u002Fclassification_models#zero-shot-audio-classification) | `zero-shot-audio-classification` | Classifying audios into classes that are unseen during training.                                                              | ❌          |\n| [Zero-Shot Image Classification](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fzero-shot-image-classification)                        | `zero-shot-image-classification` | Classifying images into classes that are unseen during training.                                                              | ✅          |\n| [Zero-Shot Object Detection](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fzero-shot-object-detection)                                | `zero-shot-object-detection`     | Identify objects of classes that are unseen during training.                                                                  | ✅          |\n\n#### Reinforcement Learning\n\n| Task                                                                          | ID  | Description                                                                                                                                | Supported? |\n|-------------------------------------------------------------------------------|-----|--------------------------------------------------------------------------------------------------------------------------------------------|------------|\n| [Reinforcement Learning](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Freinforcement-learning) | N\u002FA | Learning from actions by interacting with an environment through trial and error and receiving rewards (negative or positive) as feedback. | ❌          |\n\n### Models\n\n1. **[ALBERT](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Falbert)** (from Google Research and the Toyota\n   Technological Institute at Chicago) released with the\n   paper [ALBERT: A Lite BERT for Self-supervised Learning of Language Representations](https:\u002F\u002Farxiv.org\u002Fabs\u002F1909.11942),\n   by Zhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel, Piyush Sharma, Radu Soricut.\n1. **[BART](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fbart)** (from Facebook) released with the\n   paper [BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehension](https:\u002F\u002Farxiv.org\u002Fabs\u002F1910.13461)\n   by Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov and Luke\n   Zettlemoyer.\n1. **[BERT](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fbert)** (from Google) released with the\n   paper [BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding](https:\u002F\u002Farxiv.org\u002Fabs\u002F1810.04805)\n   by Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova.\n1. **[BERT For Sequence Generation](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fbert-generation)** (from Google)\n   released with the\n   paper [Leveraging Pre-trained Checkpoints for Sequence Generation Tasks](https:\u002F\u002Farxiv.org\u002Fabs\u002F1907.12461) by Sascha\n   Rothe, Shashi Narayan, Aliaksei Severyn.\n1. **[BERTweet](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fbertweet)** (from VinAI Research) released with the\n   paper [BERTweet: A pre-trained language model for English Tweets](https:\u002F\u002Faclanthology.org\u002F2020.emnlp-demos.2\u002F) by\n   Dat Quoc Nguyen, Thanh Vu and Anh Tuan Nguyen.\n1. **[BigBird-Pegasus](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fbigbird_pegasus)** (from Google Research)\n   released with the paper [Big Bird: Transformers for Longer Sequences](https:\u002F\u002Farxiv.org\u002Fabs\u002F2007.14062) by Manzil\n   Zaheer, Guru Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula,\n   Qifan Wang, Li Yang, Amr Ahmed.\n1. **[BigBird-RoBERTa](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fbig_bird)** (from Google Research) released\n   with the paper [Big Bird: Transformers for Longer Sequences](https:\u002F\u002Farxiv.org\u002Fabs\u002F2007.14062) by Manzil Zaheer, Guru\n   Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang,\n   Li Yang, Amr Ahmed.\n1. **[CLIP](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fclip)** (from OpenAI) released with the\n   paper [Learning Transferable Visual Models From Natural Language Supervision](https:\u002F\u002Farxiv.org\u002Fabs\u002F2103.00020) by\n   Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda\n   Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, Ilya Sutskever.\n1. **[CodeGen](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fcodegen)** (from Salesforce) released with the\n   paper [A Conversational Paradigm for Program Synthesis](https:\u002F\u002Farxiv.org\u002Fabs\u002F2203.13474) by Erik Nijkamp, Bo Pang,\n   Hiroaki Hayashi, Lifu Tu, Huan Wang, Yingbo Zhou, Silvio Savarese, Caiming Xiong.\n1. **[ConvBERT](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fconvbert)** (from YituTech) released with the\n   paper [ConvBERT: Improving BERT with Span-based Dynamic Convolution](https:\u002F\u002Farxiv.org\u002Fabs\u002F2008.02496) by Zihang\n   Jiang, Weihao Yu, Daquan Zhou, Yunpeng Chen, Jiashi Feng, Shuicheng Yan.\n1. **[DeBERTa](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fdeberta)** (from Microsoft) released with the\n   paper [DeBERTa: Decoding-enhanced BERT with Disentangled Attention](https:\u002F\u002Farxiv.org\u002Fabs\u002F2006.03654) by Pengcheng\n   He, Xiaodong Liu, Jianfeng Gao, Weizhu Chen.\n1. **[DeBERTa-v2](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fdeberta-v2)** (from Microsoft) released with the\n   paper [DeBERTa: Decoding-enhanced BERT with Disentangled Attention](https:\u002F\u002Farxiv.org\u002Fabs\u002F2006.03654) by Pengcheng\n   He, Xiaodong Liu, Jianfeng Gao, Weizhu Chen.\n1. **[DETR](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fdetr)** (from Facebook) released with the\n   paper [End-to-End Object Detection with Transformers](https:\u002F\u002Farxiv.org\u002Fabs\u002F2005.12872) by Nicolas Carion, Francisco\n   Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, Sergey Zagoruyko.\n1. **[DistilBERT](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fdistilbert)** (from HuggingFace), released together\n   with the\n   paper [DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter](https:\u002F\u002Farxiv.org\u002Fabs\u002F1910.01108)\n   by Victor Sanh, Lysandre Debut and Thomas Wolf. The same method has been applied to compress GPT2\n   into [DistilGPT2](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftransformers\u002Ftree\u002Fmain\u002Fexamples\u002Fresearch_projects\u002Fdistillation),\n   RoBERTa\n   into [DistilRoBERTa](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftransformers\u002Ftree\u002Fmain\u002Fexamples\u002Fresearch_projects\u002Fdistillation),\n   Multilingual BERT\n   into [DistilmBERT](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftransformers\u002Ftree\u002Fmain\u002Fexamples\u002Fresearch_projects\u002Fdistillation) and\n   a German version of DistilBERT.\n1. **[Donut](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fdonut)** (from NAVER), released together with the\n   paper [OCR-free Document Understanding Transformer](https:\u002F\u002Farxiv.org\u002Fabs\u002F2111.15664) by Geewook Kim, Teakgyu Hong,\n   Moonbin Yim, Jeongyeon Nam, Jinyoung Park, Jinyeong Yim, Wonseok Hwang, Sangdoo Yun, Dongyoon Han, Seunghyun Park.\n1. **[ELECTRA](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Felectra)** (from Google Research\u002FStanford University)\n   released with the\n   paper [ELECTRA: Pre-training text encoders as discriminators rather than generators](https:\u002F\u002Farxiv.org\u002Fabs\u002F2003.10555)\n   by Kevin Clark, Minh-Thang Luong, Quoc V. Le, Christopher D. Manning.\n1. **[FLAN-T5](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fflan-t5)** (from Google AI) released in the\n   repository [google-research\u002Ft5x](https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Ft5x\u002Fblob\u002Fmain\u002Fdocs\u002Fmodels.md#flan-t5-checkpoints)\n   by Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Eric Li, Xuezhi Wang, Mostafa\n   Dehghani, Siddhartha Brahma, Albert Webson, Shixiang Shane Gu, Zhuyun Dai, Mirac Suzgun, Xinyun Chen, Aakanksha\n   Chowdhery, Sharan Narang, Gaurav Mishra, Adams Yu, Vincent Zhao, Yanping Huang, Andrew Dai, Hongkun Yu, Slav Petrov,\n   Ed H. Chi, Jeff Dean, Jacob Devlin, Adam Roberts, Denny Zhou, Quoc V. Le, and Jason Wei\n1. **[GPT-2](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fgpt2)** (from OpenAI) released with the\n   paper [Language Models are Unsupervised Multitask Learners](https:\u002F\u002Fblog.openai.com\u002Fbetter-language-models\u002F) by Alec\n   Radford*, Jeffrey Wu*, Rewon Child, David Luan, Dario Amodei** and Ilya Sutskever**.\n1. **[GPT-J](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fgptj)** (from EleutherAI) released in the\n   repository [kingoflolz\u002Fmesh-transformer-jax](https:\u002F\u002Fgithub.com\u002Fkingoflolz\u002Fmesh-transformer-jax\u002F) by Ben Wang and\n   Aran Komatsuzaki.\n1. **[GPTBigCode](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fgpt_bigcode)** (from BigCode) released with the\n   paper [SantaCoder: don't reach for the stars!](https:\u002F\u002Farxiv.org\u002Fabs\u002F2301.03988) by Loubna Ben Allal, Raymond Li,\n   Denis Kocetkov, Chenghao Mou, Christopher Akiki, Carlos Munoz Ferrandis, Niklas Muennighoff, Mayank Mishra, Alex Gu,\n   Manan Dey, Logesh Kumar Umapathi, Carolyn Jane Anderson, Yangtian Zi, Joel Lamy Poirier, Hailey Schoelkopf, Sergey\n   Troshin, Dmitry Abulkhanov, Manuel Romero, Michael Lappert, Francesco De Toni, Bernardo García del Río, Qian Liu,\n   Shamik Bose, Urvashi Bhattacharyya, Terry Yue Zhuo, Ian Yu, Paulo Villegas, Marco Zocca, Sourab Mangrulkar, David\n   Lansky, Huu Nguyen, Danish Contractor, Luis Villa, Jia Li, Dzmitry Bahdanau, Yacine Jernite, Sean Hughes, Daniel\n   Fried, Arjun Guha, Harm de Vries, Leandro von Werra.\n1. **[M2M100](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fm2m_100)** (from Facebook) released with the\n   paper [Beyond English-Centric Multilingual Machine Translation](https:\u002F\u002Farxiv.org\u002Fabs\u002F2010.11125) by Angela Fan,\n   Shruti Bhosale, Holger Schwenk, Zhiyi Ma, Ahmed El-Kishky, Siddharth Goyal, Mandeep Baines, Onur Celebi, Guillaume\n   Wenzek, Vishrav Chaudhary, Naman Goyal, Tom Birch, Vitaliy Liptchinsky, Sergey Edunov, Edouard Grave, Michael Auli,\n   Armand Joulin.\n1. **[MobileBERT](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fmobilebert)** (from CMU\u002FGoogle Brain) released with\n   the paper [MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devices](https:\u002F\u002Farxiv.org\u002Fabs\u002F2004.02984)\n   by Zhiqing Sun, Hongkun Yu, Xiaodan Song, Renjie Liu, Yiming Yang, and Denny Zhou.\n1. **[OWL-ViT](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fowlvit)** (from Google AI) released with the\n   paper [Simple Open-Vocabulary Object Detection with Vision Transformers](https:\u002F\u002Farxiv.org\u002Fabs\u002F2205.06230) by\n   Matthias Minderer, Alexey Gritsenko, Austin Stone, Maxim Neumann, Dirk Weissenborn, Alexey Dosovitskiy, Aravindh\n   Mahendran, Anurag Arnab, Mostafa Dehghani, Zhuoran Shen, Xiao Wang, Xiaohua Zhai, Thomas Kipf, and Neil Houlsby.\n1. **[OWLv2](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fowlv2)** (from Google AI) released with the\n   paper [Scaling Open-Vocabulary Object Detection](https:\u002F\u002Farxiv.org\u002Fabs\u002F2306.09683) by Matthias Minderer, Alexey\n   Gritsenko, Neil Houlsby.\n1. **[RoBERTa](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Froberta)** (from Facebook), released together with the\n   paper [RoBERTa: A Robustly Optimized BERT Pretraining Approach](https:\u002F\u002Farxiv.org\u002Fabs\u002F1907.11692) by Yinhan Liu, Myle\n   Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, Veselin Stoyanov.\n1. **[RoBERTa-PreLayerNorm](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Froberta-prelayernorm)** (from Facebook)\n   released with the paper [fairseq: A Fast, Extensible Toolkit for Sequence Modeling](https:\u002F\u002Farxiv.org\u002Fabs\u002F1904.01038)\n   by Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, Michael Auli.\n1. **[RoFormer](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Froformer)** (from ZhuiyiTechnology), released\n   together with the\n   paper [RoFormer: Enhanced Transformer with Rotary Position Embedding](https:\u002F\u002Farxiv.org\u002Fabs\u002F2104.09864) by Jianlin Su\n   and Yu Lu and Shengfeng Pan and Bo Wen and Yunfeng Liu.\n1. **[SigLIP](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmain\u002Fmodel_doc\u002Fsiglip)** (from Google AI) released with the\n   paper [Sigmoid Loss for Language Image Pre-Training](https:\u002F\u002Farxiv.org\u002Fabs\u002F2303.15343) by Xiaohua Zhai, Basil\n   Mustafa, Alexander Kolesnikov, Lucas Beyer.\n1. **[Swin2SR](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fswin2sr)** (from University of Würzburg) released with\n   the\n   paper [Swin2SR: SwinV2 Transformer for Compressed Image Super-Resolution and Restoration](https:\u002F\u002Farxiv.org\u002Fabs\u002F2209.11345)\n   by Marcos V. Conde, Ui-Jin Choi, Maxime Burchi, Radu Timofte.\n1. **[T5](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Ft5)** (from Google AI) released with the\n   paper [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https:\u002F\u002Farxiv.org\u002Fabs\u002F1910.10683)\n   by Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi\n   Zhou and Wei Li and Peter J. Liu.\n1. **[T5v1.1](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Ft5v1.1)** (from Google AI) released in the\n   repository [google-research\u002Ftext-to-text-transfer-transformer](https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Ftext-to-text-transfer-transformer\u002Fblob\u002Fmain\u002Freleased_checkpoints.md#t511)\n   by Colin Raffel and Noam Shazeer and Adam Roberts and Katherine Lee and Sharan Narang and Michael Matena and Yanqi\n   Zhou and Wei Li and Peter J. Liu.\n1. **[TrOCR](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Ftrocr)** (from Microsoft), released together with the\n   paper [TrOCR: Transformer-based Optical Character Recognition with Pre-trained Models](https:\u002F\u002Farxiv.org\u002Fabs\u002F2109.10282)\n   by Minghao Li, Tengchao Lv, Lei Cui, Yijuan Lu, Dinei Florencio, Cha Zhang, Zhoujun Li, Furu Wei.\n1. **[Vision Transformer (ViT)](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fvit)** (from Google AI) released with\n   the\n   paper [An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale](https:\u002F\u002Farxiv.org\u002Fabs\u002F2010.11929)\n   by Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa\n   Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, Neil Houlsby.\n1. **[YOLOS](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fyolos)** (from Huazhong University of Science &\n   Technology) released with the\n   paper [You Only Look at One Sequence: Rethinking Transformer in Vision through Object Detection](https:\u002F\u002Farxiv.org\u002Fabs\u002F2106.00666)\n   by Yuxin Fang, Bencheng Liao, Xinggang Wang, Jiemin Fang, Jiyang Qi, Rui Wu, Jianwei Niu, Wenyu Liu.\n","\u003Ch1 align=\"center\">\n   TransformersPHP\n\u003C\u002Fh1>\n\n\u003Ch3 align=\"center\">\n    \u003Cp>面向 PHP 的最先进机器学习框架\u003C\u002Fp>\n\u003C\u002Fh3>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fcodewithkyrian\u002Ftransformers\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fdt\u002Fcodewithkyrian\u002Ftransformers\" alt=\"总下载量\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fpackagist.org\u002Fpackages\u002Fcodewithkyrian\u002Ftransformers\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fpackagist\u002Fv\u002Fcodewithkyrian\u002Ftransformers\" alt=\"最新稳定版本\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fblob\u002Fmain\u002FLICENSE\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002Fcodewithkyrian\u002Ftransformers-php\" alt=\"许可证\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fcodewithkyrian\u002Ftransformers-php\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Frepo-size\u002Fcodewithkyrian\u002Ftransformers-php\" alt=\"文档\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Factions\u002Fworkflows\u002Ftests.yml\">\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Factions\u002Fworkflows\u002Ftests.yml\u002Fbadge.svg\" alt=\"测试\">\u003C\u002Fa>\n\u003C\u002Fp>\n\nTransformersPHP 的设计目标是与 Python 库功能完全一致，同时保持相同的性能和易用性。该库基于 Hugging Face 的 Transformers 库构建，后者提供了 100 多种语言的数千个预训练模型。它专为 PHP 开发者打造，采用与 Python 库相似的 API，简单易用。这些模型可用于多种任务，包括文本生成、摘要提取、翻译等。\n\nTransformersPHP 使用 [ONNX Runtime](https:\u002F\u002Fonnxruntime.ai\u002F) 来运行模型，这是一种用于 Open Neural Network Exchange (ONNX) 模型的高性能推理引擎。您可以轻松将任何 PyTorch 或 TensorFlow 模型转换为 ONNX 格式，并借助 [🤗 Optimum](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Foptimum#onnx--onnx-runtime) 在 TransformersPHP 中使用。\n\n如需了解更多关于该库及其工作原理的信息，请访问我们的[详细文档](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fintroduction)。\n\n## 快速入门\n\n由于 TransformersPHP 的设计目标是与 Python 库功能完全一致，因此您可以轻松地从现有的 Python 或 JavaScript 代码中学习。我们提供了 `pipeline` API，这是一个高级、易于使用的接口，可将模型与其必要的预处理和后处理步骤组合在一起。\n\n\u003Ctable>\n\u003Ctr>\n\n\u003Cth align=\"center\">\u003Cb>Python（原版）\u003C\u002Fb>\u003C\u002Fth>\n\u003Cth align=\"center\">\u003Cb>PHP（我们）\u003C\u002Fb>\u003C\u002Fth>\n\u003Cth align=\"center\">\u003Cb>Javascript（Xenova）\u003C\u002Fb>\u003C\u002Fth>\n\n\u003C\u002Ftr>\n\n\u003Ctr>\n\u003Ctd>\n\n```python\nfrom transformers import pipeline\n\n# 分配一个情感分析管道\npipe = pipeline('sentiment-analysis')\n\nout = pipe('I love transformers!')\n# [{'label': 'POSITIVE', 'score': 0.999806941}]\n```\n\n\u003C\u002Ftd>\n\u003Ctd>\n\n```php\nuse function Codewithkyrian\\Transformers\\Pipelines\\pipeline;\n\n\u002F\u002F 分配一个情感分析管道\n$pipe = pipeline('sentiment-analysis');\n\n$out = $pipe('I love transformers!');\n\u002F\u002F [{'label': 'POSITIVE', 'score': 0.999808732}]\n```\n\n\u003C\u002Ftd>\n\u003Ctd>\n\n```javascript\nimport {pipeline} from '@xenova\u002Ftransformers';\n\n\u002F\u002F 分配一个情感分析管道\nlet pipe = await pipeline('sentiment-analysis');\n\nlet out = await pipe('I love transformers!');\n\u002F\u002F [{'label': 'POSITIVE', 'score': 0.999817686}]\n```\n\n\u003C\u002Ftd>\n\u003C\u002Ftr>\n\u003C\u002Ftable>\n\n您还可以通过在 `pipeline` 函数中指定模型 ID 或路径来使用不同的模型。例如：\n\n```php\nuse function Codewithkyrian\\Transformers\\Pipelines\\pipeline;\n\n\u002F\u002F 分配一个翻译管道\n$pipe = pipeline('translation', 'Xenova\u002Fdistilbert-base-uncased-finetuned-sst-2-english');\n```\n\n## 安装\n\n您可以通过 Composer 安装该库。这是推荐的安装方式。\n\n```bash\ncomposer require codewithkyrian\u002Ftransformers\n```\n\n> [!CAUTION]\n> ONNX 库具有平台特定性，因此务必在代码将要执行的目标平台上运行 `composer require` 命令。大多数情况下，这将是您的开发机器或部署应用程序的服务器；但如果您使用的是 Docker 容器，请在该容器内运行 `composer require` 命令。\n\n## PHP FFI 扩展\n\nTransformersPHP 使用 PHP FFI 扩展与 ONNX 运行时进行交互。FFI 扩展默认包含在 PHP 7.4 及更高版本中，但可能未默认启用。如果 FFI 扩展未启用，您可以通过取消注释（移除行首的 `;`）以下行来启用它：\n\n```ini\nextension = ffi\n```\n\n此外，您还需要在 `php.ini` 文件中将 `ffi.enable` 指令设置为 `true`：\n\n```ini\nffi.enable = true\n```\n\n完成这些更改后，请重启您的 Web 服务器或 PHP-FPM 服务，即可正常使用。\n\n## 文档\n\n有关如何使用该库的更多详细信息，请参阅文档：[https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php)\n\n## 使用方法\n\n默认情况下，TransformersPHP 使用托管的预训练 ONNX 模型。对于支持的任务，那些已转换为可在 Hugging Face 上与 [Xenova's Transformers.js](https:\u002F\u002Fhuggingface.co\u002Fmodels?library=transformers.js) 配合使用的模型，可以直接在 TransformersPHP 中使用。\n\n## 配置\n\n您可以按如下方式配置 TransformersPHP 库的行为：\n\n```php\nuse Codewithkyrian\\Transformers\\Transformers;\n\nTransformers::setup()\n    ->setCacheDir('...') \u002F\u002F 设置变压器模型的默认缓存目录，默认为 `.transformers-cache\u002Fmodels`\n    ->setRemoteHost('...') \u002F\u002F 设置下载模型的远程主机，默认为 `https:\u002F\u002Fhuggingface.co`\n    ->setRemotePathTemplate('...') \u002F\u002F 设置下载模型的远程路径模板，默认为 `{model}\u002Fresolve\u002F{revision}\u002F{file}`\n    ->setAuthToken('...') \u002F\u002F 设置下载模型的认证令牌，默认为 `null`\n    ->setUserAgent('...') \u002F\u002F 设置下载模型的用户代理，默认为 `transformers-php\u002F{version}`\n    ->setImageDriver('...') \u002F\u002F 设置图像处理驱动程序，默认为 `VIPS`\n    ->setLogger($logger) \u002F\u002F 设置兼容 PSR-3 的日志记录器，默认为 `NullLogger`，若未设置则使用此值\n    ->apply(); \u002F\u002F 应用配置\n```\n\n您可以按任意顺序调用 `set` 方法，也可以完全省略某些方法，此时将使用默认值。有关配置选项及其含义的更多信息，请参阅[文档](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fconfiguration)。\n\n## 将您的模型转换为 ONNX\n\nTransformersPHP 仅支持 ONNX 模型，因此您必须将 PyTorch、TensorFlow 或 JAX 模型转换为 ONNX 格式。我们建议使用 Transformers.js 提供的 [转换脚本](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftransformers.js\u002Fblob\u002Fmain\u002Fscripts\u002Fconvert.py)，该脚本在后台利用 [🤗 Optimum](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Foptimum) 来完成模型的转换和量化。\n\n```\npython -m convert --quantize --model_id \u003Cmodel_name_or_path>\n```\n\n## 预先下载模型\n\n默认情况下，当您首次使用流水线或预训练模型时，TransformersPHP 会自动从 Hugging Face 模型库中获取 ONNX 格式的模型权重。这可能会导致首次使用时出现轻微延迟。为了提升用户体验，建议在 PHP 应用程序中运行模型之前，预先下载您计划使用的模型，尤其是大型模型。一种方法是手动执行一次请求，但 TransformersPHP 也提供了一个命令行工具来帮助您完成这一操作：\n\n```bash\n.\u002Fvendor\u002Fbin\u002Ftransformers download \u003Cmodel_identifier> [\u003Ctask>] [options]\n```\n\n参数说明：\n\n- **\u003Cmodel_identifier>**：指定您要下载的模型。您可以通过浏览 Hugging Face 模型库（https:\u002F\u002Fhuggingface.co\u002Fmodels?library=transformers.js）找到模型标识符。\n- **[\\\u003Ctask\\>]**：（可选）此参数允许下载特定任务的配置和权重。如果您知道将使用该模型的具体任务（例如“text2text-generation”），则此选项会很有帮助。\n- **[options]**：（可选）您可以使用额外的选项进一步自定义下载过程：\n    - **--cache_dir=\\\u003Cdirectory\\>**：指定存储已下载模型的目录（默认为配置的缓存目录）。您可以在命令中使用 -c 作为快捷方式。\n    - **--quantized=\\\u003Ctrue|false\\>**：如果可用，则下载量化的模型版本（默认为 true）。量化后的模型体积更小、速度更快，但准确性可能略低。您可以在命令中使用 -q 作为快捷方式。\n\n> [!CAUTION]\n> 请务必将您的缓存目录添加到 `.gitignore` 文件中，以避免将已下载的模型提交到您的 Git 仓库。\n\n## 支持的任务\u002F模型\n\n本包目前仍在开发中，但以下是 TransformersPHP 当前测试并支持的任务和架构列表。\n\n### 任务\n\n#### 自然语言处理\n\n| 任务                                                                                                   | ID                                            | 描述                                                                                    | 支持？ |\n|--------------------------------------------------------------------------------------------------------|-----------------------------------------------|------------------------------------------------------------------------------------------------|------------|\n| [填空掩码](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ffill-mask)                               | `fill-mask`                                   | 对句子中的部分词语进行掩码，并预测应替换这些掩码的词语。 | ✅          |\n| [问答](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fquestion-answering)             | `question-answering`                          | 从给定文本中检索问题的答案。                                           | ✅          |\n| [句子相似度](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fsentence-similarity)           | `sentence-similarity`                         | 确定两段文本的相似程度。                                                         | ✅          |\n| [摘要生成](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fsummarization)                       | `summarization`                               | 在保留文档重要信息的前提下，生成较短版本的文档。          | ✅          |\n| [表格问答](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Ftable-question-answering)                      | `table-question-answering`                    | 回答关于给定表格信息的问题。                                     | ❌          |\n| [文本分类](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ftext-classification)           | `text-classification` 或 `sentiment-analysis` | 为给定文本分配标签或类别。                                                    | ✅          |\n| [文本生成](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ftext-generation)                   | `text-generation`                             | 通过预测序列中的下一个词来生成新文本。                                  | ✅          |\n| [文本到文本生成](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ftext-to-text-generation)   | `text2text-generation`                        | 将一个文本序列转换为另一个文本序列。                                       | ✅          |\n| [标记分类](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ftoken-classification)         | `token-classification` 或 `ner`               | 为文本中的每个标记分配标签。                                                     | ✅          |\n| [翻译](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ftranslation)                           | `translation`                                 | 将文本从一种语言翻译成另一种语言。                                                  | ✅          |\n| [零样本分类](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fzero-shot-classification) | `zero-shot-classification`                    | 将文本分类到训练过程中未见过的类别中。                                 | ✅          |\n\n#### 视觉\n\n| 任务                                                                                           | ID                     | 描述                                                                                                                                                                             | 支持吗？ |\n|------------------------------------------------------------------------------------------------|------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|\n| [深度估计](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fdepth-estimation)         | `depth-estimation`     | 预测图像中物体的深度。                                                                                                                                    | ❌          |\n| [图像分类](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fimage-classification) | `image-classification` | 为整张图像分配一个标签或类别。                                                                                                                                          | ✅          |\n| [图像分割](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fimage-segmentation)     | `image-segmentation`   | 将图像划分为多个区域，每个像素对应于某个对象。该任务有多种变体，如实例分割、全景分割和语义分割。 | ❌          |\n| [图像到图像](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fimage-to-image)             | `image-to-image`       | 将源图像转换为与目标图像或目标图像域特征相匹配的形式。                                                                                    | ✅          |\n| [掩码生成](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fmask-generation)           | `mask-generation`      | 为图像中的对象生成掩码。                                                                                                                                             | ❌          |\n| [目标检测](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fobject-detection)         | `object-detection`     | 在图像中识别特定类别的目标。                                                                                                                            | ✅          |\n\n#### 音频\n\n| 任务                                                                                      | ID                                  | 描述                                          | 支持吗？ |\n|-------------------------------------------------------------------------------------------|-------------------------------------|------------------------------------------------------|------------|\n| [音频分类](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Faudio-classification)                 | `audio-classification`              | 为给定的音频分配一个标签或类别。         | ❌          |\n| [音频到音频](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Faudio-to-audio)                             | 无                                 | 从输入音频源生成音频。         | ❌          |\n| [自动语音识别](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Fautomatic-speech-recognition) | `automatic-speech-recognition`      | 将给定的音频转录成文本。                | ❌          |\n| [文本到语音](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Ftext-to-speech)                             | `text-to-speech` 或 `text-to-audio` | 根据文本输入生成自然流畅的语音。 | ❌          |\n\n#### 表格数据\n\n| 任务                                                                          | ID  | 描述                                                         | 支持吗？ |\n|-------------------------------------------------------------------------------|-----|---------------------------------------------------------------------|------------|\n| [表格数据分类](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Ftabular-classification) | 无 | 基于一组属性对目标类别（群体）进行分类。 | ❌          |\n| [表格数据回归](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Ftabular-regression)         | 无 | 根据一组属性预测数值。             | ❌          |\n\n#### 多模态\n\n| 任务                                                                                                                                      | ID                               | 描述                                                                                                                   | 支持吗？ |\n|-------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------|-------------------------------------------------------------------------------------------------------------------------------|------------|\n| [文档问答](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Fdocument-question-answering)                                                                   | `document-question-answering`    | 对文档图像中的问题进行回答。                                                                                       | ❌          |\n| [特征提取](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Ffeature-extraction)                                                | `feature-extraction`             | 将原始数据转换为可处理的数值特征，同时保留原始数据集中的信息。 | ✅          |\n| [图像特征提取](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fimage-feature-extraction)                                    | `image-feature-extraction`       | 从图像中提取特征。                                                                                              | ✅          |\n| [图像转文本](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fimage-to-text)                                                          | `image-to-text`                  | 根据给定的图像输出文本。                                                                                               | ✅          |\n| [文本转图像](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Ftext-to-image)                                                                               | `text-to-image`                  | 根据输入文本生成图像。                                                                                             | ❌          |\n| [视觉问答](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Fvisual-question-answering)                                                       | `visual-question-answering`      | 根据图像回答开放式问题。                                                                             | ❌          |\n| [零样本音频分类](https:\u002F\u002Fhuggingface.co\u002Flearn\u002Faudio-course\u002Fchapter4\u002Fclassification_models#zero-shot-audio-classification) | `zero-shot-audio-classification` | 将音频分类到训练过程中未见过的类别中。                                                              | ❌          |\n| [零样本图像分类](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fzero-shot-image-classification)                        | `zero-shot-image-classification` | 将图像分类到训练过程中未见过的类别中。                                                              | ✅          |\n| [零样本目标检测](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-php\u002Fzero-shot-object-detection)                                | `zero-shot-object-detection`     | 识别训练过程中未见过的类别的物体。                                                                  | ✅          |\n\n#### 强化学习\n\n| 任务                                                                          | ID  | 描述                                                                                                                                | 支持吗？ |\n|-------------------------------------------------------------------------------|-----|--------------------------------------------------------------------------------------------------------------------------------------------|------------|\n| [强化学习](https:\u002F\u002Fhuggingface.co\u002Ftasks\u002Freinforcement-learning) | N\u002FA | 通过与环境交互、试错并接收奖励（正或负）作为反馈来学习行动策略。 | ❌          |\n\n\n\n### 模型\n\n1. **[ALBERT](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Falbert)**（由谷歌研究院和芝加哥丰田技术研究所共同开发）随论文《ALBERT：用于自监督语言表示学习的轻量级BERT》一同发布，作者为Zhenzhong Lan、Mingda Chen、Sebastian Goodman、Kevin Gimpel、Piyush Sharma和Radu Soricut。\n1. **[BART](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fbart)**（由Facebook开发）随论文《BART：面向自然语言生成、翻译和理解的去噪序列到序列预训练》一同发布，作者为Mike Lewis、Yinhan Liu、Naman Goyal、Marjan Ghazvininejad、Abdelrahman Mohamed、Omer Levy、Ves Stoyanov和Luke Zettlemoyer。\n1. **[BERT](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fbert)**（由谷歌开发）随论文《BERT：用于语言理解的深度双向Transformer预训练》一同发布，作者为Jacob Devlin、Ming-Wei Chang、Kenton Lee和Kristina Toutanova。\n1. **[BERT For Sequence Generation](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fbert-generation)**（由谷歌开发）随论文《利用预训练检查点进行序列生成任务》一同发布，作者为Sascha Rothe、Shashi Narayan和Aliaksei Severyn。\n1. **[BERTweet](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fbertweet)**（由VinAI Research开发）随论文《BERTweet：面向英文推文的预训练语言模型》一同发布，作者为Dat Quoc Nguyen、Thanh Vu和Anh Tuan Nguyen。\n1. **[BigBird-Pegasus](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fbigbird_pegasus)**（由谷歌研究院开发）随论文《Big Bird：适用于更长序列的Transformer》一同发布，作者为Manzil Zaheer、Guru Guruganesh、Avinava Dubey、Joshua Ainslie、Chris Alberti、Santiago Ontanon、Philip Pham、Anirudh Ravula、Qifan Wang、Li Yang和Amr Ahmed。\n1. **[BigBird-RoBERTa](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fbig_bird)**（由谷歌研究院开发）随论文《Big Bird：适用于更长序列的Transformer》一同发布，作者同上。\n1. **[CLIP](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fclip)**（由OpenAI开发）随论文《从自然语言监督中学习可迁移视觉模型》一同发布，作者为Alec Radford、Jong Wook Kim、Chris Hallacy、Aditya Ramesh、Gabriel Goh、Sandhini Agarwal、Girish Sastry、Amanda Askell、Pamela Mishkin、Jack Clark、Gretchen Krueger和Ilya Sutskever。\n1. **[CodeGen](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fcodegen)**（由Salesforce开发）随论文《面向程序合成的对话式范式》一同发布，作者为Erik Nijkamp、Bo Pang、Hiroaki Hayashi、Lifu Tu、Huan Wang、Yingbo Zhou、Silvio Savarese和Caiming Xiong。\n1. **[ConvBERT](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fconvbert)**（由YituTech开发）随论文《ConvBERT：基于跨度的动态卷积改进BERT》一同发布，作者为Zihang Jiang、Weihao Yu、Daquan Zhou、Yunpeng Chen、Jiashi Feng和Shuicheng Yan。\n1. **[DeBERTa](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fdeberta)**（由微软开发）随论文《DeBERTa：解耦注意力机制的解码增强型BERT》一同发布，作者为Pengcheng He、Xiaodong Liu、Jianfeng Gao和Weizhu Chen。\n1. **[DeBERTa-v2](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fdeberta-v2)**（由微软开发）随论文《DeBERTa：解耦注意力机制的解码增强型BERT》一同发布，作者同上。\n1. **[DETR](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fdetr)**（由Facebook开发）随论文《基于Transformer的端到端目标检测》一同发布，作者为Nicolas Carion、Francisco Massa、Gabriel Synnaeve、Nicolas Usunier、Alexander Kirillov和Sergey Zagoruyko。\n1. **[DistilBERT](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fdistilbert)**（由HuggingFace开发），随论文《DistilBERT：BERT的蒸馏版本——更小、更快、更便宜、更轻》一同发布，作者为Victor Sanh、Lysandre Debut和Thomas Wolf。同样的方法也被应用于将GPT2压缩为[DistilGPT2](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftransformers\u002Ftree\u002Fmain\u002Fexamples\u002Fresearch_projects\u002Fdistillation)，将RoBERTa压缩为[DistilRoBERTa](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftransformers\u002Ftree\u002Fmain\u002Fexamples\u002Fresearch_projects\u002Fdistillation)，将多语言BERT压缩为[DistilmBERT](https:\u002F\u002Fgithub.com\u002Fhuggingface\u002Ftransformers\u002Ftree\u002Fmain\u002Fexamples\u002Fresearch_projects\u002Fdistillation)，以及德语版的DistilBERT。\n1. **[Donut](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fdonut)**（由NAVER开发），随论文《无OCR文档理解Transformer》一同发布，作者为Geewook Kim、Teakgyu Hong、Moonbin Yim、Jeongyeon Nam、Jinyoung Park、Jinyeong Yim、Wonseok Hwang、Sangdoo Yun、Dongyoon Han和Seunghyun Park。\n1. **[ELECTRA](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Felectra)**（由谷歌研究院\u002F斯坦福大学联合开发）随论文《ELECTRA：将文本编码器作为判别器而非生成器进行预训练》一同发布，作者为Kevin Clark、Minh-Thang Luong、Quoc V. Le和Christopher D. Manning。\n1. **[FLAN-T5](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fflan-t5)**（由Google AI开发）在[google-research\u002Ft5x](https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Ft5x\u002Fblob\u002Fmain\u002Fdocs\u002Fmodels.md#flan-t5-checkpoints)仓库中发布，作者为Hyung Won Chung、Le Hou、Shayne Longpre、Barret Zoph、Yi Tay、William Fedus、Eric Li、Xuezhi Wang、Mostafa Dehghani、Siddhartha Brahma、Albert Webson、Shixiang Shane Gu、Zhuyun Dai、Mirac Suzgun、Xinyun Chen、Aakanksha Chowdhery、Sharan Narang、Gaurav Mishra、Adams Yu、Vincent Zhao、Yanping Huang、Andrew Dai、Hongkun Yu、Slav Petrov、Ed H. Chi、Jeff Dean、Jacob Devlin、Adam Roberts、Denny Zhou、Quoc V. Le和Jason Wei。\n1. **[GPT-2](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fgpt2)**（由OpenAI开发）随论文《语言模型是无监督的多任务学习者》一同发布，作者为Alec Radford*、Jeffrey Wu*、Rewon Child、David Luan、Dario Amodei**和Ilya Sutskever**。\n1. **[GPT-J](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fgptj)**（由EleutherAI开发）在[kingoflolz\u002Fmesh-transformer-jax](https:\u002F\u002Fgithub.com\u002Fkingoflolz\u002Fmesh-transformer-jax\u002F)仓库中发布，作者为Ben Wang和Aran Komatsuzaki。\n1. **[GPTBigCode](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fgpt_bigcode)**（由BigCode开发）随论文《SantaCoder：不要好高骛远！》一同发布，作者为Loubna Ben Allal、Raymond Li、Denis Kocetkov、Chenghao Mou、Christopher Akiki、Carlos Munoz Ferrandis、Niklas Muennighoff、Mayank Mishra、Alex Gu、Manan Dey、Logesh Kumar Umapathi、Carolyn Jane Anderson、Yangtian Zi、Joel Lamy Poirier、Hailey Schoelkopf、Sergey Troshin、Dmitry Abulkhanov、Manuel Romero、Michael Lappert、Francesco De Toni、Bernardo García del Río、Qian Liu、Shamik Bose、Urvashi Bhattacharyya、Terry Yue Zhuo、Ian Yu、Paulo Villegas、Marco Zocca、Sourab Mangrulkar、David Lansky、Huu Nguyen、Danish Contractor、Luis Villa、Jia Li、Dzmitry Bahdanau、Yacine Jernite、Sean Hughes、Daniel Fried、Arjun Guha、Harm de Vries和Leandro von Werra。\n1. **[M2M100](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fm2m_100)**（由Facebook开发）随论文《超越以英语为中心的多语言机器翻译》一同发布，作者为Angela Fan、Shruti Bhosale、Holger Schwenk、Zhiyi Ma、Ahmed El-Kishky、Siddharth Goyal、Mandeep Baines、Onur Celebi、Guillaume Wenzek、Vishrav Chaudhary、Naman Goyal、Tom Birch、Vitaliy Liptchinsky、Sergey Edunov、Edouard Grave、Michael Auli和Armand Joulin。\n1. **[MobileBERT](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fmobilebert)**（由CMU\u002FGoogle Brain联合开发）随论文《MobileBERT：一种适用于资源受限设备的紧凑型任务无关BERT》一同发布，作者为Zhiqing Sun、Hongkun Yu、Xiaodan Song、Renjie Liu、Yiming Yang和Denny Zhou。\n1. **[OWL-ViT](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fowlvit)**（由Google AI开发）随论文《使用Vision Transformer实现简单的开放词汇目标检测》一同发布，作者为Matthias Minderer、Alexey Gritsenko、Austin Stone、Maxim Neumann、Dirk Weissenborn、Alexey Dosovitskiy、Aravindh Mahendran、Anurag Arnab、Mostafa Dehghani、Zhuoran Shen、Xiao Wang、Xiaohua Zhai、Thomas Kipf和Neil Houlsby。\n1. **[OWLv2](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fowlv2)**（由Google AI开发）随论文《扩展开放词汇目标检测》一同发布，作者为Matthias Minderer、Alexey Gritsenko和Neil Houlsby。\n1. **[RoBERTa](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Froberta)**（由Facebook开发），随论文《RoBERTa：一种鲁棒优化的BERT预训练方法》一同发布，作者为Yinhan Liu、Myle Ott、Naman Goyal、Jingfei Du、Mandar Joshi、Danqi Chen、Omer Levy、Mike Lewis、Luke Zettlemoyer和Veselin Stoyanov。\n1. **[RoBERTa-PreLayerNorm](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Froberta-prelayernorm)**（由Facebook开发）随论文《fairseq：一个快速、可扩展的序列建模工具包》一同发布，作者为Myle Ott、Sergey Edunov、Alexei Baevski、Angela Fan、Sam Gross、Nathan Ng、David Grangier和Michael Auli。\n1. **[RoFormer](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Froformer)**（由ZhuiyiTechnology开发），随论文《RoFormer：带有旋转位置嵌入的增强型Transformer》一同发布，作者为Jianlin Su、Yu Lu、Shengfeng Pan、Bo Wen和Yunfeng Liu。\n1. **[SigLIP](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmain\u002Fmodel_doc\u002Fsiglip)**（由Google AI开发）随论文《用于语言图像预训练的Sigmoid损失》一同发布，作者为Xiaohua Zhai、Basil Mustafa、Alexander Kolesnikov和Lucas Beyer。\n1. **[Swin2SR](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fswin2sr)**（由维尔茨堡大学开发）随论文《Swin2SR：用于压缩图像超分辨率和修复的SwinV2 Transformer》一同发布，作者为Marcos V. Conde、Ui-Jin Choi、Maxime Burchi和Radu Timofte。\n1. **[T5](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Ft5)**（由Google AI开发）随论文《通过统一的文本到文本Transformer探索迁移学习的极限》一同发布，作者为Colin Raffel、Noam Shazeer、Adam Roberts、Katherine Lee、Sharan Narang、Michael Matena、Yanqi Zhou、Wei Li和Peter J. Liu。\n1. **[T5v1.1](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Ft5v1.1)**（由Google AI开发）在[google-research\u002Ftext-to-text-transfer-transformer](https:\u002F\u002Fgithub.com\u002Fgoogle-research\u002Ftext-to-text-transfer-transformer\u002Fblob\u002Fmain\u002Freleased_checkpoints.md#t511)仓库中发布，作者同上。\n1. **[TrOCR](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Ftrocr)**（由微软开发），随论文《TrOCR：基于Transformer的预训练模型光学字符识别》一同发布，作者为Minghao Li、Tengchao Lv、Lei Cui、Yijuan Lu、Dinei Florencio、Cha Zhang、Zhoujun Li和Furu Wei。\n1. **[Vision Transformer (ViT)](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fvit)**（由Google AI开发）随论文《一张图胜过16×16个词：大规模图像识别中的Transformer》一同发布，作者为Alexey Dosovitskiy、Lucas Beyer、Alexander Kolesnikov、Dirk Weissenborn、Xiaohua Zhai、Thomas Unterthiner、Mostafa Dehghani、Matthias Minderer、Georg Heigold、Sylvain Gelly、Jakob Uszkoreit和Neil Houlsby。\n1. **[YOLOS](https:\u002F\u002Fhuggingface.co\u002Fdocs\u002Ftransformers\u002Fmodel_doc\u002Fyolos)**（由华中科技大学开发）随论文《你只看一个序列：通过目标检测重新思考视觉中的Transformer》一同发布，作者为Yuxin Fang、Bencheng Liao、Xinggang Wang、Jiemin Fang、Jiyang Qi、Rui Wu、Jianwei Niu和Wenyu Liu。","# TransformersPHP 快速上手指南\n\nTransformersPHP 是一个为 PHP 开发者设计的机器学习库，功能上等同于 Python 的 Hugging Face Transformers 库。它基于 ONNX Runtime 运行，支持文本生成、摘要、翻译、情感分析等多种任务，旨在提供高性能且易于使用的 API。\n\n## 1. 环境准备\n\n在开始之前，请确保你的开发环境满足以下要求：\n\n*   **PHP 版本**：PHP 7.4 或更高版本。\n*   **FFI 扩展**：TransformersPHP 依赖 PHP FFI 扩展与 ONNX Runtime 交互。\n    *   FFI 扩展通常包含在 PHP 7.4+ 中，但默认可能未启用。\n    *   请在 `php.ini` 文件中检查并修改以下配置：\n        ```ini\n        extension = ffi\n        ffi.enable = true\n        ```\n    *   修改后，请重启 Web 服务器或 PHP-FPM 服务。\n*   **Composer**：用于管理 PHP 依赖包。\n*   **平台一致性**：ONNX 库具有平台特异性。**务必在代码最终运行的目标平台（如生产服务器或 Docker 容器内部）执行安装命令**，以确保二进制文件兼容。\n\n## 2. 安装步骤\n\n推荐使用 Composer 进行安装。在你的项目根目录下运行以下命令：\n\n```bash\ncomposer require codewithkyrian\u002Ftransformers\n```\n\n> **注意**：如果你使用 Docker，请确保在容器内运行上述命令，而不是在宿主机上运行。\n\n## 3. 基本使用\n\nTransformersPHP 提供了与 Python 库高度相似的 `pipeline` API，只需几行代码即可实现复杂的 NLP 任务。\n\n### 示例：情感分析\n\n以下代码演示如何使用预训练模型进行情感分析：\n\n```php\n\u003C?php\n\nrequire 'vendor\u002Fautoload.php';\n\nuse function Codewithkyrian\\Transformers\\Pipelines\\pipeline;\n\n\u002F\u002F 初始化情感分析管道\n$pipe = pipeline('sentiment-analysis');\n\n\u002F\u002F 执行预测\n$out = $pipe('I love transformers!');\n\n\u002F\u002F 输出结果: [{'label': 'POSITIVE', 'score': 0.999808732}]\nprint_r($out);\n```\n\n### 指定特定模型\n\n你可以通过传递模型 ID 作为第二个参数来使用特定的模型（例如用于翻译或其他任务）：\n\n```php\n\u003C?php\n\nrequire 'vendor\u002Fautoload.php';\n\nuse function Codewithkyrian\\Transformers\\Pipelines\\pipeline;\n\n\u002F\u002F 指定模型 ID 初始化管道\n$pipe = pipeline('translation', 'Xenova\u002Fdistilbert-base-uncased-finetuned-sst-2-english');\n\n\u002F\u002F 执行任务\n$out = $pipe('Your text here');\n```\n\n### 预下载模型（可选优化）\n\n默认情况下，模型会在首次运行时从 Hugging Face 自动下载，这可能导致初次请求延迟。建议在生产环境中预先下载模型：\n\n```bash\n.\u002Fvendor\u002Fbin\u002Ftransformers download \u003Cmodel_identifier> [\u003Ctask>]\n```\n\n例如：\n```bash\n.\u002Fvendor\u002Fbin\u002Ftransformers download Xenova\u002Fdistilbert-base-uncased-finetuned-sst-2-english\n```\n\n更多高级配置（如缓存目录、代理设置等）请参考官方文档。","某电商平台的 PHP 后端团队需要为商品评论系统引入智能情感分析功能，以便自动识别用户评价是正面还是负面，从而优化推荐算法和客服响应优先级。\n\n### 没有 transformers-php 时\n\n- **架构复杂且维护成本高**：团队必须额外部署一套 Python 微服务来运行机器学习模型，导致技术栈分裂，增加了服务器资源消耗和运维难度。\n- **通信延迟影响体验**：PHP 主应用需要通过 HTTP 或 gRPC 调用外部 Python 服务，网络往返带来的延迟使得实时分析变得困难，尤其在流量高峰时容易成为瓶颈。\n- **开发协作壁垒高**：后端 PHP 开发者不熟悉 Python 生态，每次调整模型参数或预处理逻辑都需要与 AI 工程师反复沟通，迭代周期长，效率低下。\n- **数据序列化开销大**：在 PHP 和 Python 之间传输大量文本数据时，JSON 序列化与反序列化的开销显著，进一步降低了系统吞吐量。\n\n### 使用 transformers-php 后\n\n- **原生集成，简化架构**：直接在现有的 PHP 项目中通过 Composer 安装 transformers-php，利用 ONNX Runtime 在本地运行模型，无需维护额外的 Python 服务，大幅降低运维复杂度。\n- **零网络延迟，性能提升**：模型推理过程在同一进程中完成，消除了网络通信开销，实现了毫秒级的情感分析响应，显著提升了用户体验和系统并发处理能力。\n- **API 熟悉，上手极快**：transformers-php 提供了与 Python 版 Hugging Face Transformers 高度一致的 `pipeline` API，PHP 开发者可以无缝迁移现有知识，独立快速完成功能开发与调试。\n- **高效数据处理**：避免了跨语言的数据序列化过程，内存管理更加高效，使得在高负载下处理海量评论数据时依然保持稳定和低资源占用。\n\ntransformers-php 让 PHP 开发者能够以原生、高效的方式直接在服务端落地前沿 AI 能力，彻底打破了语言生态间的壁垒，实现了技术栈的统一与性能的最优化。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FCodeWithKyrian_transformers-php_aaf832d7.png","CodeWithKyrian","Kyrian Obikwelu","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FCodeWithKyrian_122eba3a.jpg",null,"@foris-labs ","Nigeria","kyrianobikwelu@gmail.com","https:\u002F\u002Fgithub.com\u002FCodeWithKyrian",[85,89,93,97],{"name":86,"color":87,"percentage":88},"PHP","#4F5D95",58.8,{"name":90,"color":91,"percentage":92},"C","#555555",39.3,{"name":94,"color":95,"percentage":96},"Python","#3572A5",1.4,{"name":98,"color":99,"percentage":100},"Jupyter Notebook","#DA5B0B",0.5,749,49,"2026-04-01T11:23:44","Apache-2.0","Linux, macOS, Windows","未说明 (基于 ONNX Runtime，通常支持 CPU 推理，具体 GPU 加速取决于 ONNX Runtime 的配置)","未说明",{"notes":109,"python":110,"dependencies":111},"1. 必须在目标运行平台（如生产服务器或 Docker 容器内）执行 'composer require' 命令，因为 ONNX 库是平台特定的。2. 需要在 php.ini 中启用 FFI 扩展并设置 'ffi.enable = true'。3. 默认使用 Hugging Face 的 ONNX 格式模型，首次运行会自动下载，建议预下载模型以提升体验。4. 若需使用自定义模型，需先通过 Python 脚本将其转换为 ONNX 格式。","无 (这是一个 PHP 库，但模型转换阶段需要 Python)",[112,113,114,115,116,117],"PHP >= 7.4","PHP FFI Extension","Composer","ONNX Runtime (平台特定二进制文件)","Python (仅用于模型转换)","Hugging Face Optimum (仅用于模型转换)",[14,26,13],[120,121,122,123],"huggingface","ml","php","transformers","2026-03-27T02:49:30.150509","2026-04-06T05:19:39.825821",[127,132,137,142,146,150],{"id":128,"question_zh":129,"answer_zh":130,"source_url":131},11237,"如何解决 Windows 系统下 rindow-matlib 版本不支持或 DLL 缺失的问题？","如果在 Windows 上遇到 matlib 版本错误或找不到 DLL 文件，请从 rindow-matlib 的 GitHub Release 页面（例如 v1.1.1）下载对应的 Windows 版本。解压后，找到 `rindowmatlib.dll` 文件，将其复制到项目目录下的 `vendor\\codewithkyrian\\transformers\\libs\\` 文件夹中，并重命名为 `librindowmatlib.dll`。","https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fissues\u002F88",{"id":133,"question_zh":134,"answer_zh":135,"source_url":136},11238,"如何在文本分类管道中获取多个标签及其分数（多标签分类）？","在调用分类器管道时，可以通过传递 `topK` 参数来控制返回的标签数量。例如，`$classifier($input, topK: 3)` 将返回得分最高的 3 个标签。如果将 `topK` 设置为 `null`，则会返回所有标签及其对应的分数。对于多标签分类，模型配置中的 `problem_type` 应设置为 `multi_label_classification`。","https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fissues\u002F46",{"id":138,"question_zh":139,"answer_zh":140,"source_url":141},11239,"为什么下载某些 HuggingFace 模型（如 briaai\u002FRMBG-2.0）时会报错？","这通常是因为该模型需要访问权限或认证令牌（Auth Token）。如果未配置正确的认证信息，下载 `config.json` 等文件时会返回 HTTP 401 错误。此外，部分模型的配置文件可能缺少 `model_type` 字段，这也可能导致解析错误，但主要问题通常是权限验证失败。请确保已正确设置 HuggingFace 的访问令牌。","https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fissues\u002F81",{"id":143,"question_zh":144,"answer_zh":145,"source_url":136},11240,"如何处理自定义的 ONNX 模型进行多标签文本分类？","虽然库主要支持 HuggingFace 模型，但你可以加载自定义的 ONNX 模型。对于多标签输出，如果 `pipeline` 的 `multiLabel` 参数行为不符合预期，可以手动处理输出：获取模型的所有 logits 输出，通过 sigmoid 函数进行归一化，然后设定一个阈值（如 0.5），筛选出所有高于该阈值的标签作为最终结果。",{"id":147,"question_zh":148,"answer_zh":149,"source_url":136},11241,"在使用 Zero-Shot 分类管道时遇到 TypeError 异常怎么办？","如果在尝试使用 Zero-Shot 分类时遇到 `str_replace(): Argument #2 ($replace) must be of type array|string, null given` 错误，这通常是因为输入格式或候选标签传递不正确。建议检查传入的参数是否符合管道要求。如果目的是多标签分类且非真正的 Zero-Shot 任务，建议直接使用文本分类管道并配合 `topK` 或手动阈值过滤来处理。",{"id":151,"question_zh":152,"answer_zh":153,"source_url":131},11242,"Linux 环境下出现 \"matlib unsupported version\" 错误如何解决？","该错误表明安装的 `rindow-matlib` 版本不在支持范围内（通常要求 >= 1.1.0 且 \u003C 2.0.0）。请检查系统中安装的 matlib 版本（例如通过 `dpkg -l | grep matlib`）。如果版本过低，请升级 `rindow-matlib` 到兼容版本（如 1.1.x 系列）。确保 PHP 扩展与库版本匹配。",[155,160,165,170,175,180,185,190,195,200,205,210,215,220,225,230,235,240],{"id":156,"version":157,"summary_zh":158,"released_at":159},61690,"0.6.2","## 变更内容\n* 允许使用 Symfony 8 组件，由 @xabbuh 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F94 中完成\n* 使用正确的方法将命令添加到 CLI 应用程序中，由 @CViniciusSDias 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F93 中完成\n* 修复：PHP 8.4 的可空类型弃用警告，由 @chr-hertel 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F97 中完成\n* 修复与 Transformers 类的命名空间冲突，由 @Flatroy 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F91 中完成\n\n## 新贡献者\n* @xabbuh 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F94 中完成了他们的首次贡献\n* @CViniciusSDias 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F93 中完成了他们的首次贡献\n* @chr-hertel 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F97 中完成了他们的首次贡献\n* @Flatroy 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F91 中完成了他们的首次贡献\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.6.1...0.6.2","2025-09-15T15:45:49",{"id":161,"version":162,"summary_zh":163,"released_at":164},61691,"0.6.1","## 新增内容\n\n- 功能：更新 Rindow Matlib 的 macOS 二进制文件，支持 ARM64 和 x86_64 架构\n- 修复：更新 Darwin 平台的目录名称\n- 杂项（CI）：在发布工作流中创建构件后清理分发目录\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.6.0...0.6.1","2025-07-21T13:00:16",{"id":166,"version":167,"summary_zh":168,"released_at":169},61692,"0.6.0","## 变更内容\n\n- 增加停止条件支持：`MaxLength`、`MaxTime` 和 `Interruptable`，以实现更灵活的生成控制。\n- 添加 PSR-3 日志记录支持。\n- 扩展 `PretrainedConfig`，减少模型文件之间的代码重复，提升可维护性。\n- 重构 `AutoModel` 解析逻辑，在未找到特定任务类时优先选择通用模型。\n- 新增对以下模型家族的支持：`Gemma`、`Gemma2`、`Gemma3`、`Qwen3` 和 `Phi3`，以及它们对应的因果语言模型。\n- 在 `FeatureExtractionPipeline` 中新增 `eos` 和 `last_token` 池化策略支持。\n- 在 `BPEModel` 中支持新的合并格式，通过 JSON 编码的词元对映射提高兼容性。\n- 引入 `PretrainedModel::$sessions` 数组，以简化子类中模型会话的管理。\n- 简化流式输出实现，提升代码清晰度和灵活性。\n- 优化图像处理方法及 VIPS 集成。\n- 转为平台包，原生支持 Linux、macOS 和 Windows（x86_64 和 ARM64）上的共享库。\n- 引入动态加载共享库机制，并实现平台特定的路径解析逻辑。\n- 更新示例配置、文档和使用说明，以反映新的架构变化。\n- 为图像工具和推理会话逻辑添加测试。\n\n## 错误修复\n\n- 修复生成过程中 `Tensor::slice()` 的错误。\n- 修正 `RepetitionPenaltyLogitsProcessor` 的逻辑，使其能够根据已生成的标记正确应用惩罚。\n- 修复与 PHP 8.1 的兼容性问题，并相应调整依赖版本。\n- 通过使用 `DIRECTORY_SEPARATOR` 修复 `HubTest` 中针对 Windows 路径的 bug。\n- 修复 `BPEModel` 在合并映射中遇到空值时的边缘情况。\n- 修复模型子类中的各类文档不一致问题及默认构造函数的 bug。\n\n## 改进\n\n- 重构库架构，以提升平台兼容性和模块化程度。\n- 重构 `Samplerate`、`Sndfile` 等 FFI 封装，改为基于实例调用的方式。\n- 改进生成配置合并逻辑及模型解析流程。\n- 统一各组件的代码风格，提升核心组件的清晰度。\n- 更新共享的原生依赖：\n    - onnxruntime → 1.21.0\n    - rindowmatlib → 1.1.1\n- 清理特征提取器，并整合模型会话逻辑。\n- 改善 FFI 调用及工具类中的错误处理。\n- 重命名内部配置和模型映射类，以提高清晰度（例如将 `PretrainedMixin` 重命名为 `AutoModelBase` 等）。\n\n## 新贡献者\n\n* @panariga 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F73 中做出了首次贡献。\n* @Deltachaos 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F77 中做出了首次贡献。\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.5.3...0.6.0","2025-07-21T11:44:54",{"id":171,"version":172,"summary_zh":173,"released_at":174},61693,"0.5.3","本次发布带来了新功能、重要的错误修复以及性能和功能的优化。以下是变更摘要。\n\n### 新增功能\n\n- **feat**: 增加对 PostProcessor Sequence 的支持，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F2cf18ccd83ad84ad8389a7f8c0198252d523f3f6 中实现。\n- **feat**: 新增张量方法 `random`，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F0564dd1609db203d4665a4c040cf1b55e4503ac9 中实现。\n- **feat**: 正确解析并使用预编译的 Normalizer，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F7e880dd9917b074d995feb98aed9bd41754429ff 中实现。\n- **feat**: 更新转换笔记本以包含任务，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002Fca6fc3b72a688ba739a6d62c062b406e7d821d25 中实现。\n\n### 错误修复\n\n- **fix**: 修复预编译 Normalizer 中的正则表达式错误，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F69089b124b299a7b7bef49b676ee5951ac7ef7fb 中修复。\n- **fix**: 改进 Unigram Tokenizer 对多字节字符串的处理，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002Fe8a8a9ab48e81692d77260197b42e15f768df086 中修复。\n- **fix**: 修正 WhitespaceSplit 预分词器对不可见空格字符的处理，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F6ec3e3e9016952913a951d838b237bfb425e07a9 中修复。\n- **fix**: 正确处理预编译 Normalizer 中的多字节字符串，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002Fbee47e01858b4c69e34eb061c571498c9e0a4e14 中修复。\n- **fix**: 修复 `fuse` 函数未能正确合并未知标记 ID 的问题，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F300801334cce6f67651665957e776764584db8bc 中修复。\n- **fix**: 修复当传入 `-1` 时张量 `topK` 方法出现的错误，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F0564dd1609db203d4665a4c040cf1b55e4503ac9 中修复。\n\n### 性能改进\n\n- **fix**: 对预编译 Normalizer 的改进，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002Fb01240076ddd50637b1135d3c5e9e55dab08a592 中完成。\n\n欢迎大家升级到最新版本并体验这些新功能。一如既往，如果您遇到任何问题或希望为项目贡献力量，请随时告知我们。\n\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.5.2...0.5.3","2024-09-27T19:54:13",{"id":176,"version":177,"summary_zh":178,"released_at":179},61694,"0.5.2","## 变更内容\n* @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F75f5d9cd671791f0542963f4541dfc6d8dad5dcb 中，使用静态列表进行字节与 Unicode 之间的转换。\n* @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F54bdee0a2b0542e57922ede1b633e462de80b0e1 中，修复了 Vips RGBA 到 RGBA 转换的错误。\n* @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002Fd613a0d1c2774ca83bb6743862c12c259cfddf71 中，增加了在下载共享库时显示进度的功能。\n* @timwhitlock 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F65 中，通过改进代码消除了在设置库基础路径时对 autoload.php 的依赖。\n\n## 新贡献者\n* @timwhitlock 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F65 中完成了首次贡献。\n\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.5.1...0.5.2","2024-08-29T13:11:53",{"id":181,"version":182,"summary_zh":183,"released_at":184},61695,"0.5.1","## 新增功能\n- **张量运算**：新增 `magnitude`、`sqrt` 和 `cosSimilarity`。\n- **Vips 二进制文件**：Vips 二进制文件现已默认打包，无需修改系统即可使用 libvips。\n\n## 错误修复\n- **错误处理**：将未知模型类型的错误级别调整为警告，以便在不中断工作流的情况下提供更清晰的反馈。\n\n## 回滚\n- **依赖项**：将 `rokka\u002Fvips` 从开发依赖回滚至普通依赖。由于 Vips 二进制文件已默认打包，现鼓励直接使用 Vips。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.5.0...0.5.1","2024-08-24T05:39:56",{"id":186,"version":187,"summary_zh":188,"released_at":189},61696,"0.5.0","我很高兴地宣布 TransformersPHP 的最新版本已发布，其中包含多项新功能、改进和错误修复。此版本为您的机器学习驱动的 PHP 应用程序带来了强大的增强功能，使操作更加高效和灵活。\n\n## 新功能\n- **新流水线：音频分类** - 使用预训练模型轻松对音频片段进行分类。\n  ```php\n  $classifier = pipeline('audio-classification', 'Xenova\u002Fast-finetuned-audioset-10-10-0.4593');\n  $audioUrl = __DIR__ . '\u002F..\u002Fsounds\u002Fcat_meow.wav';\n  $output = $classifier($audioUrl);\n  \u002F\u002F [\n  \u002F\u002F   [\n  \u002F\u002F     \"label\" => \"喵\"\n  \u002F\u002F     \"score\" => 0.6109990477562\n  \u002F\u002F   ]\n  \u002F\u002F ]\n  ```\n\n- **新流水线：自动语音识别 (ASR)** - 支持 `wav2vec` 和 `whisper` 等模型，用于将语音转录为文本。如果特定模型未被官方支持，请提交功能请求问题。\n  - 示例：\n    ```php\n    $transcriber = pipeline('asr', 'Xenova\u002Fwhisper-tiny.en');\n    $audioUrl = __DIR__ . '\u002F..\u002Fsounds\u002Fpreamble.wav';\n    $output = $transcriber($audioUrl, maxNewTokens: 256);\n    \u002F\u002F [\n    \u002F\u002F   \"text\" => \"我们，美利坚合众国的人民，...”\n    \u002F\u002F ]\n    ```\n\n## 增强功能\n- **共享库依赖项**：重新设计了下载共享库依赖项的工作流程，确保其版本正确，从而减小下载体积。这些二进制文件现已在 Apple Silicon、Intel Mac、Linux x86_64、Linux aarch64 和 Windows 平台上经过全面测试。\n\n- **简化 `Transformers::setup`**：`Transformers::setup()` 现在是可选的。如果不调用，则会自动应用默认设置。`apply()` 方法不再必要，但仍保留以保持向后兼容性。\n\n- **不可变图像工具类**：图像工具类现已成为不可变类。每次操作都会返回一个新的实例，从而支持方法链式调用，并提供更可预测的工作流。\n  ```php\n  $image = Image::read($url);\n  $resizedImage = $image->resize(100, 100);\n  \u002F\u002F $image 保持不变\n  ```\n\n- **新增张量运算**：新增了 `copyTo`、`log`、`exp`、`pow`、`sum`、`reciprocal` 和 `stdMean` 等运算。此外，张量运算的整体性能也得到了提升。\n\n- **TextStreamer 改进**：TextStreamer 现在默认输出到标准输出流。您可以通过 `onStream(callable $callback)` 方法覆盖此行为。因此，`StdoutStreamer` 类现已废弃。\n\n- **VIPS PHP 驱动更新**：VIPS PHP 驱动不再默认打包在 `composer.json` 中。我们提供了详细的文档，指导您如何安装 Vips PHP 驱动并在本地机器上配置 Vips。\n\n- **ONNX Runtime 升级**：升级至 1.19.0 版本，进一步提升了性能并增强了与新型号的兼容性。\n\n- **Bug 修复与性能优化**：针对包内的稳定性与性能，实施了多项 Bug 修复。\n\n我 h","2024-08-21T03:00:21",{"id":191,"version":192,"summary_zh":193,"released_at":194},61697,"0.4.4","## 变更内容\n* 功能性更新：新增可选的主机参数，用于模型下载，由 @k99k5 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F56 中实现。\n\n## 新贡献者\n* @k99k5 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F56 中完成了首次贡献。\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.4.3...0.4.4","2024-08-14T16:10:24",{"id":196,"version":197,"summary_zh":198,"released_at":199},61698,"0.4.3","## 变更内容\n* 由 @BlackyDrum 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F42 中修复了文档中的拼写错误\n* 修复：在 PHP 8.3 中已弃用的 FFI::new 静态调用问题，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F48 中完成\n* 修复：改进 NllbTokenizer 中用于检测语言代码的正则表达式，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F49 中完成\n* 修复：当文本中不含数字时，digits 预处理分词器会返回空数组的问题，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F51 中解决\n* [新功能：允许在通过 CLI 下载模型时传递模型文件名](https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F91db063eab90da732f301a028e23a0a00ee25979)\n* 修复：当没有文本对时，preTokenizer 会出现 null 错误](https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F901a049b8bd837c83d3edcd517dd76cf8e3ba6b9)\n* 新功能：实现图像特征提取器的尺寸可除性强制检查，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F53 中完成\n\n## 新贡献者\n* @BlackyDrum 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F42 中完成了首次贡献\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.4.2...0.4.3","2024-07-31T15:02:19",{"id":201,"version":202,"summary_zh":203,"released_at":204},61699,"0.4.2","## 变更内容\n* 修复bug：在 Windows 系统中，仓库 URL 解析功能无法正常工作，由 @CodeWithKyrian 在 https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F41 中修复。\n\n\n**完整变更日志**：https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.4.1...0.4.2","2024-06-05T07:43:51",{"id":206,"version":207,"summary_zh":208,"released_at":209},61700,"0.4.1","## What's Changed\r\n* configuration.md: fix indentation of Transformers::setup() by @k00ni in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F35\r\n* PretrainedTokenizer::truncateHelper: prevent array_slice() error for flawed text input (summarization) by @k00ni in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F36\r\n* Fix bug with Download CLI - use named parameters for model construct by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F39\r\n\r\n## New Contributors\r\n* @k00ni made their first contribution in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F35\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.4.0...0.4.1","2024-05-24T03:52:06",{"id":211,"version":212,"summary_zh":213,"released_at":214},61701,"0.4.0","This release marks a significant milestone in enhancing the performance and functionality of the Tensor class while introducing convenient tools to streamline the installation of essential dependencies. These improvements not only optimize existing operations but also pave the way for future enhancements and expanded capabilities within the project.\r\n\r\n## What's Changed\r\n\r\n- **New Inference Session**: The InferenceSession has been overhauled to now receive Tensor inputs directly, facilitating easier conversion of Tensor objects to ONNX Tensors by simplifying memory copying.\r\n- **Overhaul Tensor Buffer Implementation**: The Tensor class has been revamped to utilize OpenBlas and Rindow Matlib C shared libraries, introducing a massive performance improvements in Tensor operations. \r\n- **PHP Buffer Fallback**: When the C Based Buffer fails for some reason, there's still a working PHP buffer implemented as a fallback, which is obviously slower, but will prevent errors. \r\n- **OpenMP Integration**: The Tensor operations can be further optimized further by utilizing the parallel operation ability of OpenMP with an optional fallback to the the non OpenMP alternatives when OpenMP isn't installed. \r\n- **New Tensor Methods**: Several new methods, including `topk`, `divide`, and `slice`, have been added to the Tensor class, along with corresponding changes to existing implementations to leverage these methods.\r\n- **Refactor Stack Method**: The `stack` method in the Tensor class has been refactored for enhanced performance.\r\n- **Move Thumbnail Method**: The thumbnail method has been relocated from the feature extractor to the Image class for improved organization.\r\n- **Code Cleanup and Style Review**: The codebase has undergone cleanup and style review to ensure consistency and readability.\r\n- **Optimize Image \u003C-> Tensor Conversion**: Efforts have been made to optimize the speed of conversion between Image and Tensor objects,  and vice versa enhancing overall performance for image related tasks.\r\n- **Image Driver Configuration**:  While Image driver setting can still be set in the `Transformers` class, it can be set directly on the `Image` class, allowing it to be used independently.\r\n- **Introduce Libraries Loader**: A new library loader package has been introduced to automate the downloading of required shared libraries, such as `onnxruntime`, `openblas`, and `rindow-matlib`, during the Composer install process.\r\n- **TinyLlama Support**: Add support for the TinyLlama model by @CodeWithKyrian \r\n- **Install Command Returned**: Returned the `install` command back to serve as an alternative way of getting the shared libraries if it fails for any reason during composer install.\r\n\r\n\r\n## New Contributors\r\n* @das-peter made their first contribution in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F30\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.3.1...0.4.0","2024-05-15T11:24:56",{"id":216,"version":217,"summary_zh":218,"released_at":219},61702,"0.3.1","## What's Changed\r\n* Add Qwen2 model support by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F20\r\n* Add chat input detection for text generation, and refactor streamer API. by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F21\r\n* bugfix: Fix error that occurs when streamer is not used by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F22\r\n* bugfix: Decoder sequence not calling the right method by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F23\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.3.0...0.3.1","2024-04-22T22:02:17",{"id":221,"version":222,"summary_zh":223,"released_at":224},61703,"0.3.0","## What's Changed\r\n* Add Image Classification pipelines support by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F9\r\n* Add Zero shot Image Classification pipelines support by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F9\r\n* Add New Image Driver - VIPS by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F10\r\n* Add Object Detection Pipeline by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F11\r\n* Download ONNXRuntime automatically after composer install by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F12\r\n* Add Zero Shot Object Detection Pipeline and OwlVit models by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F14\r\n* Improve tensor performance by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F13\r\n* Set [MASK] usage in prompts for default Xenova\u002Fbert-base-uncased model by @takielias in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F15\r\n* Add image feature extraction pipeline by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F16\r\n* Add image to image pipeline by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F17\r\n* bugfix: https slashes affected when joining paths by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F19\r\n\r\n## Breaking Changes\r\n* The install command no longer exists, as the required libraries are downloaded automatically on composer install.\r\n* New Image driver configuration settings added that required either GD, Imagick or Vips\r\n\r\n## New Contributors\r\n* @takielias made their first contribution in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F15\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.2.2...0.3.0","2024-04-13T23:58:30",{"id":226,"version":227,"summary_zh":228,"released_at":229},61704,"0.2.2","## What's new\r\n\r\n- bugfix: Fix the wrong argument being passed in Autotokenizer by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F05e55888d9ad0184103061347a427b259afb360e\r\n- feat: cache tokenizer output to improve speed in repetitive tasks leading to 75% speed improvement (11.7687s to 2.9687s) by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002Fb115c28f526dfbde13457c00f5306d05a51c445b\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.2.1...0.2.2","2024-03-25T20:03:28",{"id":231,"version":232,"summary_zh":233,"released_at":234},61705,"0.2.1","## What's Changed\r\n* bugfix: Add symfony\u002Fconsole explicitly as a dependency by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F7\r\n* bugfix: Autoload errors for `WordPieceTokenizer` on case-sensitive operating systems in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002F0f1fc8bda91fb3df9492057a4224b171d2e3f2d5\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.2.0...0.2.1\r\n\r\n","2024-03-22T06:16:43",{"id":236,"version":237,"summary_zh":238,"released_at":239},61706,"0.2.0","## What's Changed\r\n* feat: Add ability to use chat templates in Text Generation by @CodeWithKyrian in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F1\r\n* bugfix: Autoload errors for `PretrainedModel` on case-sensitive operating systems by @CodeWithKyrian  in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fpull\u002F4\r\n* feat: Bump OnnxRuntime PHP to 0.2.0 in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002Fb3331623cf6696aacbbad0f8c33530086404424d\r\n* feat: Improve download and install command interfaces to show progress bar in https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcommit\u002Fb3331623cf6696aacbbad0f8c33530086404424d\r\n\r\n\r\n**Full Changelog**: https:\u002F\u002Fgithub.com\u002FCodeWithKyrian\u002Ftransformers-php\u002Fcompare\u002F0.1.0...0.2.0","2024-03-21T11:51:02",{"id":241,"version":242,"summary_zh":243,"released_at":244},61707,"0.1.0","# Initial Release 🎉\r\n\r\nWe are thrilled to announce the launch of Transformers PHP, a groundbreaking library that brings the power of state-of-the-art machine learning to the PHP community. Inspired by the HuggingFace Transformers and Xenova Transformers.js, Transformers PHP aims to provide an easy-to-use, high-performance toolset for developers looking to integrate advanced NLP, and in future updates potentially more, capabilities into their PHP applications.\r\n\r\n## Key Features:\r\n\r\n- **Seamless Integration:** Designed to be functionally equivalent to its Python counterpart, making the transition and usage straightforward for developers familiar with the original Transformers library.\r\n- **Performance Optimized:** Utilizes ONNX Runtime for efficient model inference, ensuring high performance even in demanding scenarios.\r\n- **Comprehensive Model Support:** Access to thousands of pre-trained models across 100+ languages, covering a wide range of tasks including text generation, summarization, translation, sentiment analysis, and more.\r\n- **Easy Model Conversion:** With 🤗 Optimum, easily convert PyTorch or TensorFlow models to ONNX format for use with Transformers PHP.\r\n- **Developer Friendly:** From installation to deployment, every aspect of Transformers PHP is designed with ease of use in mind, featuring extensive documentation and a streamlined API.\r\n\r\n## Getting Started:\r\n\r\nInstallation is a breeze with Composer:\r\n\r\n```bash\r\ncomposer require codewithkyrian\u002Ftransformers\r\n```\r\nAnd you must initialize the library to download neccesary libraries for ONNX\r\n```bash\r\n.\u002Fvendor\u002Fbin\u002Ftransformers install\r\n```\r\n\r\n## Checkout the Documentation\r\n\r\nFor a comprehensive guide on how to use Transformers PHP, including detailed examples and configuration options, visit our [documentation](https:\u002F\u002Fcodewithkyrian.github.io\u002Ftransformers-docs\u002Fdocs).\r\n\r\n## Pre-Download Models:\r\n\r\nTo ensure a smooth user experience, especially with larger models, we recommend pre-downloading models before deployment. Transformers PHP includes a handy CLI tool for this purpose:\r\n\r\n```bash\r\n.\u002Fvendor\u002Fbin\u002Ftransformers download \u003Cmodel_identifier>\r\n```\r\n\r\n## What's Next?\r\n\r\nThis initial release lays the groundwork for a versatile machine learning toolkit within the PHP ecosystem. We are committed to continuous improvement and expansion of Transformers PHP, with future updates aimed at increasing supported tasks, enhancing functionality, and broadening the scope of models.\r\n\r\n## Get Involved!\r\n\r\nWe encourage feedback, contributions, and discussions from the community. Whether you're reporting bugs, requesting features, or contributing code, your input is invaluable in making Transformers PHP better for everyone.\r\n\r\n## Acknowledgments:\r\n\r\nA huge thank you to Hugging Face for their incredible work on the Transformers library, to Xenova for inspiring this package,  and to the broader machine learning community for their ongoing research and contributions. Transformers PHP stands on the shoulders of giants, and we are excited to see how it will empower PHP developers to push the boundaries of what's possible.","2024-03-15T08:13:11"]