abidlabs HF staff commited on
Commit
518d994
1 Parent(s): 2e20dca

Create landing.md

Browse files
Files changed (1) hide show
  1. landing.md +124 -0
landing.md ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p align="center">
2
+ <img width="200" src="gradio-discord.jpg">
3
+ </p>
4
+
5
+ # The Gradio Discord Bot<sup>BETA</sup>
6
+
7
+ The Gradio Discord Bot is a way to use any [Hugging Face Space](https://hf.space) as a Bot from within your Discord server -- *all without writing any code*.
8
+
9
+ Below, we show examples how to use the Bot in your server to:
10
+
11
+ - 🌎 Translate between languages
12
+ - 🗣️ Convert text to speech
13
+ - 🔢 Do math calculations
14
+ - 🖼️ Generate images
15
+
16
+ All for free and without having to code anything! Installation instructions are below, or you can try it out right now in the [#gradio-bot-playground channel](https://discord.gg/Q7ZSBrZHjx) in the Hugging Face Discord.
17
+
18
+ ## Installing in your own Discord Server
19
+
20
+ Installing the Gradio Discord Bot is very simple:
21
+
22
+ 1. Copy and paste the following link in your browser: https://discord.com/api/oauth2/authorize?client_id=1040198143695933501&permissions=294406716480&scope=bot
23
+
24
+ 2. Choose which Discord server you'd like to add it to (you must have permissions to add Bots to that server of course)
25
+
26
+ <p align="center">
27
+ <img width="600" alt="image" src="https://user-images.githubusercontent.com/1778297/208466659-00b23d23-fdc1-48e7-8868-dd248510acce.png">
28
+ </p>
29
+
30
+ 3. Accept the permissions for the Gradio Bot
31
+
32
+ <p align="center">
33
+ <img width="600" alt="image" src="https://user-images.githubusercontent.com/1778297/208466719-a6d64e0e-3aa1-4ead-90fc-23480f441b90.png">
34
+ </p>
35
+
36
+ * You can confirm that the Gradio Discord Bot has been successfully installed in your server by going to the server and seeing if there is an account with the name `@GradioBot` in your server:
37
+
38
+ <p align="center">
39
+ <img width="517" alt="image" src="https://user-images.githubusercontent.com/1778297/208510477-7a634158-885f-4083-981a-483d19ae7416.png">
40
+ </p>
41
+
42
+ 4. (Optional) If you would like to use `@GradioBot` in a private channel, then you must add `@GradioBot` to that channel. In Discord, you can do this by right-clicking on the channel name, and then selecting ‘Edit Channel’. Then, go to ‘Permissions’ and select ‘Add a Role’ and find `@GradioBot`
43
+
44
+
45
+ ## Usage
46
+
47
+ Now that the Gradio Discord bot is installed, here's how to use it in any any channel in your Discord server:
48
+
49
+ 1. From the channel, tag `@GradioBot` followed by the name of a Space you'd like to try,
50
+ such as `abidlabs/en2fr` ([a Space](https://huggingface.co/spaces/abidlabs/en2fr) that translates from English to French) or `abidlabs/speak` ([a Space](https://huggingface.co/spaces/abidlabs/speak) that converts text to spoken speech), or any of the more than 5,000 Gradio demos on [Hugging Face Spaces](https://hf.space).
51
+
52
+ <p align="center">
53
+ <img width="446" alt="image" src="https://user-images.githubusercontent.com/1778297/208513251-5ba2e8bc-82e6-4037-995b-dfbba0720126.png">
54
+ </p>
55
+
56
+ 2. Once you press enter, you'll notice that the name of `@GradioBot` will change to reflect the name of the Space that it has loaded:
57
+
58
+ <p align="center">
59
+ <img width="572" alt="image" src="https://user-images.githubusercontent.com/1778297/208517352-ca167539-c78a-4226-9cd1-c8fe6c1a2645.png">
60
+ </p>
61
+
62
+ 3. Now type in the input you'd like to pass into the Space. In this example, we'll pass in an English phrase: "Hello, friends." The input **must be enclosed in double-quotes**. Otherwise, it will be interpreted as the name of a new Space that you are trying to load. Once you
63
+
64
+ <p align="center">
65
+ <img width="438" alt="image" src="https://user-images.githubusercontent.com/1778297/208517591-f8024af3-fa2e-41e4-b043-994c4ce5693b.png">
66
+ </p>
67
+
68
+ 4. If you'd like to load a new Space, just type in the name of a new Space (without any quotation marks) and `@GradioBot` will load the new Space instead. If you'd like to reset to the initial state of the `@GradioBot`, you can type in `@GradioBot exit`.
69
+
70
+ We'll show how to use `@GradioBot` with a few more complex Spaces below:
71
+
72
+ ## More examples
73
+
74
+ ### 🗣️ Convert text to speech (`abidlabs/speak`)
75
+
76
+ The `@GradioBot` can handle media as well as text. For example, [this Space](https://huggingface.co/spaces/abidlabs/speak) converts text to speech recordings. Here's how to use it:
77
+
78
+ 1. In a channel, type `@GradioBot abidlabs/speak`
79
+
80
+ 2. Then, type in some text *in quotation marks* that you'd like to convert to speech, such as `@GradioBot "Look at this cool demo!"`. You should see an audio file returned by `@GradioBot`:
81
+
82
+ <p align="center">
83
+ <img width="519" alt="image" src="https://user-images.githubusercontent.com/1778297/208524742-f568ec4e-accb-4087-9acb-0bdad80fd7d2.png">
84
+ </p>
85
+
86
+
87
+ *Note*: generation can take a minute or even longer, depending on the length of the input and how many other people are using this Space
88
+
89
+ ### 🔢 Do math calculations (`abidlabs/calc`)
90
+
91
+ The `@GradioBot` can handle Spaces that take multiple inputs. Each input **must be in quotes and separated by a space**. For example, [this Space](https://huggingface.co/spaces/abidlabs/calc) takes in two numbers and a mathematical operation. Here's how to use it:
92
+
93
+ 1. In a channel, type `@GradioBot abidlabs/calc`
94
+
95
+ 2. Then, type in `@GradioBot `, followed by the inputs, separated by Spaces. For example: `@GradioBot "4" "divide" "3"` Here's how it looks:
96
+
97
+ <p align="center">
98
+ <img width="430" alt="image" src="https://user-images.githubusercontent.com/1778297/208525038-21f8273c-53ce-46ec-9423-1694ac646da6.png">
99
+ </p>
100
+
101
+
102
+ ### 🖼️ Generate images (`abidlabs/images`)
103
+
104
+ Here's another example that shows that `@GradioBot` can handle media. Using [this Space](https://huggingface.co/spaces/abidlabs/speak) converts text to images. Here's how to use it:
105
+
106
+ 1. In a channel, type `@GradioBot abidlabs/images`
107
+
108
+ 2. Then, type in some text *in quotation marks* that you'd like to convert into an image, such as `@GradioBot "a cartoon astronaut riding a horse"`. You should see an image file returned by `@GradioBot`:
109
+
110
+ <p align="center">
111
+ <img width="437" alt="image" src="https://user-images.githubusercontent.com/1778297/208525226-c61c6263-5e68-448f-ae9d-25602732285f.png">
112
+ </p>
113
+
114
+
115
+ *Note*: generation can take a minute or even longer, depending on how many other people are using this Space
116
+
117
+ ## About
118
+
119
+ The first version of the Gradio Discord Bot was built by the [Gradio team](https://www.gradio.dev) at a hackathon in Paris in Nov. 2022. We hope you enjoy it and find it useful!
120
+
121
+ ## Contributing
122
+
123
+ The Gradio Discord Bot is completely open-source. Feel free to open issues or pull requests in this repo to make it better!
124
+