Spaces:
Sleeping
Sleeping
Create RemoveTimestampsAPI.md
Browse files
docs/Whisper/RemoveTimestampsAPI.md
ADDED
@@ -0,0 +1,68 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# API Documentation for `Lenylvt/Whisper_Timestamps_Remover-API`
|
2 |
+
This guide provides instructions for interacting with the Whisper Timestamps Remover API using Python and JavaScript.
|
3 |
+
|
4 |
+
## API Endpoint
|
5 |
+
|
6 |
+
This API is accessible via the `gradio_client` Python library [docs](https://www.gradio.app/guides/getting-started-with-the-python-client) or the `@gradio/client` JavaScript package [docs](https://www.gradio.app/guides/getting-started-with-the-js-client).
|
7 |
+
|
8 |
+
## Python Usage
|
9 |
+
|
10 |
+
### Step 1: Installation
|
11 |
+
|
12 |
+
Ensure you have the `gradio_client` library installed before proceeding.
|
13 |
+
|
14 |
+
```python
|
15 |
+
pip install gradio_client
|
16 |
+
```
|
17 |
+
|
18 |
+
### Step 2: Making a Request
|
19 |
+
|
20 |
+
Find the API endpoint relevant to the function you're interested in. Replace the placeholders in the code snippet below with your specific input data. If accessing a private Space, your Hugging Face token may be required.
|
21 |
+
|
22 |
+
**API Name**: `/predict`
|
23 |
+
|
24 |
+
```python
|
25 |
+
from gradio_client import Client
|
26 |
+
|
27 |
+
client = Client("Lenylvt/Whisper_Timestamps_Remover-API")
|
28 |
+
result = client.predict(
|
29 |
+
"Hello!!", # Input text as a string in 'text' Textbox component
|
30 |
+
api_name="/predict"
|
31 |
+
)
|
32 |
+
print(result)
|
33 |
+
```
|
34 |
+
|
35 |
+
**Return Type(s):**
|
36 |
+
|
37 |
+
- A `str` representing the processed output in the 'output' Textbox component.
|
38 |
+
|
39 |
+
## JavaScript Usage
|
40 |
+
|
41 |
+
### Step 1: Installation
|
42 |
+
|
43 |
+
First, make sure the `@gradio/client` package is installed in your project.
|
44 |
+
|
45 |
+
```bash
|
46 |
+
npm i -D @gradio/client
|
47 |
+
```
|
48 |
+
|
49 |
+
### Step 2: Making a Request
|
50 |
+
|
51 |
+
As in Python, locate the API endpoint for the functionality you need. Replace the placeholders with your data. Include your Hugging Face token if accessing a private Space.
|
52 |
+
|
53 |
+
**API Name**: `/predict`
|
54 |
+
|
55 |
+
```javascript
|
56 |
+
import { client } from "@gradio/client";
|
57 |
+
|
58 |
+
const app = await client("Lenylvt/Whisper_Timestamps_Remover-API");
|
59 |
+
const result = await app.predict("/predict", [
|
60 |
+
"Hello!!", // Input text as a string in 'text' Textbox component
|
61 |
+
]);
|
62 |
+
|
63 |
+
console.log(result.data);
|
64 |
+
```
|
65 |
+
|
66 |
+
**Return Type(s):**
|
67 |
+
|
68 |
+
- A `string` representing the processed output in the 'output' Textbox component.
|