Lenylvt commited on
Commit
3ec6543
β€’
1 Parent(s): 69614ad

Rename docs/Text_to_SRT/api.md to docs/Text_to_SRT/API.md

Browse files
Files changed (2) hide show
  1. docs/Text_to_SRT/API.md +69 -0
  2. docs/Text_to_SRT/api.md +0 -3
docs/Text_to_SRT/API.md ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # API Documentation for `Lenylvt/Text_to_SRT-API`
2
+
3
+ This documentation covers how to interact with the Text_to_SRT API using both Python and JavaScript.
4
+
5
+ ## API Endpoint
6
+
7
+ To use this API, you can choose between the `gradio_client` Python library [docs](https://www.gradio.app/guides/getting-started-with-the-python-client) or the `@gradio/client` JavaScript package [doc](https://www.gradio.app/guides/getting-started-with-the-js-client).
8
+
9
+ ## Python Usage
10
+
11
+ ### Step 1: Installation
12
+
13
+ First, install the `gradio_client` if it's not already installed.
14
+
15
+ ```python
16
+ pip install gradio_client
17
+ ```
18
+
19
+ ### Step 2: Making a Request
20
+
21
+ Find the API endpoint for the function you want to use. Replace the placeholder values in the snippet below with your input data. For private Spaces, you might need to include your Hugging Face token as well.
22
+
23
+ **API Name**: `/text_to_srt`
24
+
25
+ ```python
26
+ from gradio_client import Client
27
+
28
+ client = Client("Lenylvt/Text_to_SRT-API")
29
+ result = client.predict(
30
+ "Hello!!", # str in 'Enter text' Textbox component
31
+ api_name="/text_to_srt"
32
+ )
33
+ print(result)
34
+ ```
35
+
36
+ **Return Type(s):**
37
+
38
+ - A `filepath` representing the output in the '*Download SRT File*' File component.
39
+
40
+ ## JavaScript Usage
41
+
42
+ ### Step 1: Installation
43
+
44
+ For JavaScript, install the `@gradio/client` package if it's not already present in your project.
45
+
46
+ ```bash
47
+ npm i -D @gradio/client
48
+ ```
49
+
50
+ ### Step 2: Making a Request
51
+
52
+ Similar to Python, find the API endpoint that matches your desired function. Replace the placeholders with your own data. Include your Hugging Face token for private Spaces.
53
+
54
+ **API Name**: `/text_to_srt`
55
+
56
+ ```javascript
57
+ import { client } from "@gradio/client";
58
+
59
+ const app = await client("Lenylvt/Text_to_SRT-API");
60
+ const result = await app.predict("/text_to_srt", [
61
+ "Hello!!", // string in 'Enter text' Textbox component
62
+ ]);
63
+
64
+ console.log(result.data);
65
+ ```
66
+
67
+ **Return Type(s):**
68
+
69
+ - `undefined` representing the output in the '*Download SRT File*' File component.
docs/Text_to_SRT/api.md DELETED
@@ -1,3 +0,0 @@
1
- # API
2
-
3
- Welcome to *first* **doc**