archich commited on
Commit
890615c
·
verified ·
1 Parent(s): 12246ed

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +39 -5
README.md CHANGED
@@ -1,12 +1,46 @@
 
 
 
 
 
1
  ---
2
- title: Hate Speech Detectorr
3
- emoji: 🔥
4
  colorFrom: red
5
- colorTo: gray
6
  sdk: gradio
7
- sdk_version: 5.49.1
8
  app_file: app.py
9
  pinned: false
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ # ============================================
3
+ # FILE: README.md
4
+ # ============================================
5
+ README_MD = '''
6
  ---
7
+ title: Hate Speech Detector API
8
+ emoji: 🛡️
9
  colorFrom: red
10
+ colorTo: blue
11
  sdk: gradio
12
+ sdk_version: "4.0.0"
13
  app_file: app.py
14
  pinned: false
15
  ---
16
 
17
+ # Hate Speech Detector API
18
+
19
+ This Space hosts the `archich/hate-speech-detector` model as an API.
20
+
21
+ ## Using the API
22
+
23
+ Once deployed, you can use this API from anywhere:
24
+
25
+ ```python
26
+ import requests
27
+
28
+ API_URL = "https://huggingface.co/spaces/YOUR_USERNAME/hate-speech-api"
29
+
30
+ response = requests.post(
31
+ f"{API_URL}/api/predict",
32
+ json={"data": ["Your text here"]}
33
+ )
34
+ result = response.json()
35
+ print(result)
36
+ ```
37
+
38
+ Or use the Gradio Client:
39
+
40
+ ```python
41
+ from gradio_client import Client
42
+
43
+ client = Client("YOUR_USERNAME/hate-speech-api")
44
+ result = client.predict("Your text here", api_name="/predict")
45
+ print(result)
46
+ ```