File size: 2,102 Bytes
254ea54
 
838a92b
254ea54
 
 
 
 
 
 
 
 
1dce6f4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
title: Chatty Vader
emoji: 💣
colorFrom: indigo
colorTo: yellow
sdk: gradio
sdk_version: 3.24.1
app_file: app.py
pinned: false
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

## Creating a voice with [Resemble.ai](https://www.resemble.ai/)

### [API Reference for creating a voice](https://docs.app.resemble.ai/docs/resource_voice/create)

1. Get your Resemble API key after creating an account with [Resemble.ai](https://www.resemble.ai/).
2. Make a request to the endpoint with the `Authorization` header set to `Token <your_resemble_api_key>` and a JSON body with `name` and the `dataset_url`:

```
{
 "name": "chatty_vader",
 "dataset_url": "https://huggingface.co/spaces/aar2dee2/chatty_vader/resolve/main/data.zip"
}
```

This will return a response like below.

```
{
  "success": true,
  "item": {
    "uuid": "10f91c43",
    "name": "chatty_vader",
    "status": "initializing",
    "dataset_url": "https://huggingface.co/spaces/aar2dee2/chatty_vader/resolve/main/data.zip",
    "created_at": "2023-04-07T06:38:29.307Z",
    "updated_at": "2023-04-07T06:38:29.323Z"
  }
}
```

If you specify a `callback_url`, you get a notification from Resemble when the voice has been created.

I temporarily modified the `app.py` so I could provide my huggingface space url as the `callback_url` in the `create a voice` request.

```
def receive_data_from_resemble(data):
    print("data from resemble", data)
    return data


iface = gr.Interface(fn=receive_data_from_resemble,
                     inputs="json", outputs="json")
iface.launch()
```

Test creating a clip
[api endpoint](https://app.resemble.ai/api/v2/projects/e2da3585/clips)
json body;

```json
{
  "title": "testing_vader",
  "body": "There is no need to panic. It will all be over soon",
  "voice_uuid": "f00d917f",
  "is_public": true,
  "callback_uri": "https://aar2dee2-chatty-vader.hf.space/run/predict"
}
```

response received:

```
{
  "success": false,
  "message": "This voice is still building and cannot be used at this time."
}
```

Same for voice id "10f91c43"