Hugging Face 适用于 Unity 的 API 此 Unity 包提供了一个易于使用的集成,用于 Hugging Face 推理 API,允许开发人员在 Unity 中使用该 API。
Hugging Face 适用于 Unity 的 API 此 Unity 包提供了一个易于使用的集成,用于 Hugging Face 推理 API,允许开发人员在 Unity 中使用该 API。
This 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.
In the Hugging Face Website:
Generate an API key in https://huggingface.co/settings/tokens, we **advise you to create a Fine-Grained Token.
When the API key is created click on Set Permissions
Authorize Inference with this API key
After installation, the Hugging Face API wizard should open. If not, open it by clicking "Window" > "Hugging Face API Wizard".
Test the API key.
Optionally, update the endpoints to use different models.
To help you getting started, we wrote a tutorial where you create a robot agent that understands text orders and executes them.
The tutorial https://thomassimonini.substack.com/p/building-a-smart-robot-ai-using-hugging
The demo https://huggingface.co/spaces/ThomasSimonini/SmartRobot
To try the included example scene, follow these steps:
The package includes a HuggingFaceAPI class that you can use from your scripts.
HuggingFace.API namespace in your script.using HuggingFace.API;
HuggingFaceAPI.TextToImage("a cat in a hat", result => {
// Do something with the result, which in this case is a Texture2D
}, error => {
// Handle errors
Debug.LogError(error);
});For a more advanced scripting example, refer to the included example scripts.
| Task | Status |
|---|---|
| Conversation | ✅ |
| Text Generation | ✅ |
| Text to Image | ✅ |
| Text Classification | ✅ |
| Zero Shot Text Classification | ✅ |
| Question Answering | ✅ |
| Translation | ✅ |
| Summarization | ✅ |
| Sentence Similarity | ✅ |
| Speech Recognition | ✅ |
If you encounter issues or have questions about the package, open an issue on the repository.
暂无开放 Issues,或尚未同步最近议题。