{"id":13711854,"url":"https://github.com/huggingface/unity-api","last_synced_at":"2025-05-06T21:32:28.252Z","repository":{"id":152240830,"uuid":"620002200","full_name":"huggingface/unity-api","owner":"huggingface","description":null,"archived":false,"fork":false,"pushed_at":"2024-06-10T14:47:36.000Z","size":582,"stargazers_count":310,"open_issues_count":13,"forks_count":28,"subscribers_count":15,"default_branch":"main","last_synced_at":"2024-08-03T23:23:56.679Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huggingface.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-27T20:49:17.000Z","updated_at":"2024-08-03T12:54:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a715656-5ad4-4149-b6e1-3fca3526edd3","html_url":"https://github.com/huggingface/unity-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Funity-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Funity-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Funity-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Funity-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huggingface","download_url":"https://codeload.github.com/huggingface/unity-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224535513,"owners_count":17327539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T23:01:12.350Z","updated_at":"2024-11-13T22:30:47.152Z","avatar_url":"https://github.com/huggingface.png","language":"C#","funding_links":[],"categories":["Project List","C# Libraries","Libraries, Platforms and Development Platform-specific Resources"],"sub_categories":["\u003cspan id=\"tool\"\u003eLLM (LLM \u0026 Tool)\u003c/span\u003e","Development Platform"],"readme":"# Hugging Face API for Unity 🤗\n\nThis Unity package provides an **easy-to-use integration for the Hugging Face Inference API**, allowing developers to access and **use Hugging Face AI models within their Unity projects**.\n\n## Table of Contents\n1. [Installation](#installation)\n2. [Usage](#usage)\n   - [Configuration](#configuration)\n   - [Example Scene](#example-scene)\n   - [API Usage in Scripts](#api-usage-in-scripts)\n3. [Tasks](#tasks)\n4. [Support](#support)\n\n## Installation\n\n### Via Git URL\n\n1. Open the Unity project you want to add the package to.\n2. Go to \"Window\" \u003e \"Package Manager\" to open the Package Manager.\n3. Click the \"+\" in the upper left hand corner and select \"Add package from git URL\".\n4. Enter the URL of this repository and click \"Add\": https://github.com/huggingface/unity-api.git\n\n## Usage\n\n### Configuration\nIn the Hugging Face Website:\n\n1. Generate an API key in https://huggingface.co/settings/tokens, we **advise you to create a Fine-Grained Token.\n\n2. When the API key is created click on Set Permissions\n\n\u003cimg src=\"https://huggingface.co/datasets/huggingface-ml-4-games-course/course-images/resolve/main/en/communication/api_step2.png\" alt=\"Hugging Face Token Step 2\"/\u003e\n\n3. Authorize Inference with this API key\n\n\u003cimg src=\"https://huggingface.co/datasets/huggingface-ml-4-games-course/course-images/resolve/main/en/communication/api_step3.png\" alt=\"Hugging Face Token Step 3\"/\u003e\n\nAfter installation, the Hugging Face API wizard should open. If not, open it by clicking \"Window\" \u003e \"Hugging Face API Wizard\".\n\n4. Test the API key.\n\n5. Optionally, update the endpoints to use different models.\n\n### Try our tutorial\n\nTo help you getting started, we wrote a tutorial where you create a robot agent that understands text orders and executes them.\n\n\nThe tutorial 👉 https://thomassimonini.substack.com/p/building-a-smart-robot-ai-using-hugging\n\nThe demo 👉 https://huggingface.co/spaces/ThomasSimonini/SmartRobot\n\n\u003cimg src=\"https://substackcdn.com/image/fetch/w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F893d861c-e6ee-416c-bc44-9a588caf4d42_1920x1080.png\" alt=\"Jammo Robot\"/\u003e\n\n### Example Scene\n\nTo try the included example scene, follow these steps:\n\n1. Click \"Install Examples\" in the Hugging Face API Wizard to copy the example files into your project.\n2. Navigate to the \"Hugging Face API\" \u003e \"Examples\" \u003e \"Scenes\" folder in your project.\n3. Open the \"ConversationExample\" scene.\n4. If prompted by the TMP Importer, click \"Import TMP Essentials\".\n5. Press \"Play\" to run the example. You should be able to use the UI to interact with the model.\n\n### API Usage in Scripts\n\nThe package includes a `HuggingFaceAPI` class that you can use from your scripts.\n\n1. Import the `HuggingFace.API` namespace in your script.\n2. Call the API method for the task you want.\n```\nusing HuggingFace.API;\n\nHuggingFaceAPI.TextToImage(\"a cat in a hat\", result =\u003e {\n    // Do something with the result, which in this case is a Texture2D\n}, error =\u003e {\n    // Handle errors\n    Debug.LogError(error);\n});\n```\n\nFor a more advanced scripting example, refer to the included example scripts.\n\n### Tasks\n\n| Task                         | Status    |\n| ---------------------------- | --------- |\n| Conversation                 | ✅     |\n| Text Generation              | ✅     |\n| Text to Image                | ✅     |\n| Text Classification          | ✅     |\n| Zero Shot Text Classification| ✅     |\n| Question Answering           | ✅     |\n| Translation                  | ✅     |\n| Summarization                | ✅     |\n| Sentence Similarity          | ✅     |\n| Speech Recognition           | ✅     |\n\n### Support\n\nIf you encounter issues or have questions about the package, open an issue on the repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuggingface%2Funity-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuggingface%2Funity-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuggingface%2Funity-api/lists"}