Commit 路
a78bfe1
1
Parent(s): 2034ad0
Add config.json and update README with metadata for HF Inference Endpoints
Browse files- README.md +22 -66
- config.json +6 -0
README.md
CHANGED
|
@@ -1,77 +1,33 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
|
| 8 |
-
- Go to https://huggingface.co/inference-endpoints
|
| 9 |
-
- Click "New endpoint"
|
| 10 |
|
| 11 |
-
|
| 12 |
-
- **Model repository**: `ajwestfield/multitalk-handler` (you'll need to upload this handler to your HF account)
|
| 13 |
-
- **Task**: Custom
|
| 14 |
-
- **Framework**: Custom
|
| 15 |
-
- **Instance type**: GPU 路 A100 路 1x GPU (80 GB)
|
| 16 |
-
|
| 17 |
-
3. **Advanced Configuration**:
|
| 18 |
-
- **Container type**: Custom
|
| 19 |
-
- **Custom image**: `pytorch/pytorch:2.4.1-cuda12.1-cudnn9-runtime`
|
| 20 |
-
- **Autoscaling**:
|
| 21 |
-
- Min replicas: 0
|
| 22 |
-
- Max replicas: 1
|
| 23 |
-
- Scale to zero after: 300 seconds (5 minutes)
|
| 24 |
-
|
| 25 |
-
4. **Environment Variables** (add these in Settings):
|
| 26 |
-
```
|
| 27 |
-
PYTORCH_CUDA_ALLOC_CONF=max_split_size_mb:512
|
| 28 |
-
CUDA_VISIBLE_DEVICES=0
|
| 29 |
-
```
|
| 30 |
-
|
| 31 |
-
## Uploading the Handler
|
| 32 |
-
|
| 33 |
-
1. Create a new model repository on Hugging Face:
|
| 34 |
-
```bash
|
| 35 |
-
huggingface-cli repo create multitalk-handler --type model
|
| 36 |
-
```
|
| 37 |
-
|
| 38 |
-
2. Upload the handler files:
|
| 39 |
-
```bash
|
| 40 |
-
cd huggingface-endpoint/multitalk-handler
|
| 41 |
-
git init
|
| 42 |
-
git add .
|
| 43 |
-
git commit -m "Add MultiTalk custom handler"
|
| 44 |
-
git remote add origin https://huggingface.co/ajwestfield/multitalk-handler
|
| 45 |
-
git push -u origin main
|
| 46 |
-
```
|
| 47 |
|
| 48 |
## Usage
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
-
|
| 53 |
-
import requests
|
| 54 |
-
import json
|
| 55 |
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
"Content-Type": "application/json"
|
| 60 |
-
}
|
| 61 |
|
| 62 |
-
|
| 63 |
-
"inputs": {
|
| 64 |
-
"prompt": "A person speaking naturally",
|
| 65 |
-
"image": "base64_encoded_image_optional"
|
| 66 |
-
},
|
| 67 |
-
"parameters": {
|
| 68 |
-
"num_frames": 16,
|
| 69 |
-
"height": 480,
|
| 70 |
-
"width": 640,
|
| 71 |
-
"num_inference_steps": 25
|
| 72 |
-
}
|
| 73 |
-
}
|
| 74 |
|
| 75 |
-
|
| 76 |
-
result = response.json()
|
| 77 |
-
```
|
|
|
|
| 1 |
+
---
|
| 2 |
+
tags:
|
| 3 |
+
- custom
|
| 4 |
+
- inference-endpoints
|
| 5 |
+
- text-to-video
|
| 6 |
+
- multitalk
|
| 7 |
+
library_name: custom
|
| 8 |
+
---
|
| 9 |
|
| 10 |
+
# MultiTalk Handler for Hugging Face Inference Endpoints
|
| 11 |
|
| 12 |
+
This is a custom handler for deploying the MeiGen-AI/MeiGen-MultiTalk model on Hugging Face Inference Endpoints.
|
| 13 |
|
| 14 |
+
## Model Description
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
This handler wraps the MeiGen-AI/MeiGen-MultiTalk model for audio-driven multi-person conversational video generation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
## Usage
|
| 19 |
|
| 20 |
+
This model should be used with Hugging Face Inference Endpoints with the following configuration:
|
| 21 |
+
- GPU: A100 (80GB recommended)
|
| 22 |
+
- Framework: Custom
|
| 23 |
+
- Task: Custom
|
| 24 |
|
| 25 |
+
## Requirements
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
- PyTorch 2.4.1
|
| 28 |
+
- CUDA 12.1
|
| 29 |
+
- Various dependencies listed in requirements.txt
|
|
|
|
|
|
|
| 30 |
|
| 31 |
+
## Handler Details
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
The custom handler (`handler.py`) implements the necessary interface for Hugging Face Inference Endpoints to run the MultiTalk model.
|
|
|
|
|
|
config.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": ["CustomHandler"],
|
| 3 |
+
"model_type": "custom",
|
| 4 |
+
"task": "text-to-video",
|
| 5 |
+
"custom_handler": true
|
| 6 |
+
}
|