Commit
·
68490c8
1
Parent(s):
7fd58b1
Update README.md
Browse files
README.md
CHANGED
@@ -49,7 +49,7 @@ ENDPOINT_URL=""# url of your endpoint
|
|
49 |
HF_TOKEN=""
|
50 |
|
51 |
# payload samples
|
52 |
-
regular_payload = { "inputs": "
|
53 |
|
54 |
# HTTP headers for authorization
|
55 |
headers= {
|
@@ -62,6 +62,7 @@ response = r.post(ENDPOINT_URL, headers=headers, json=paramter_payload)
|
|
62 |
classified = response.json()
|
63 |
|
64 |
print(classified)
|
|
|
65 |
```
|
66 |
|
67 |
|
@@ -69,9 +70,9 @@ print(classified)
|
|
69 |
**curl example**
|
70 |
|
71 |
```bash
|
72 |
-
curl https://
|
73 |
-X POST \
|
74 |
-
|
75 |
-H "Authorization: Bearer XXX" \
|
76 |
-
-H "Content-Type:
|
77 |
```
|
|
|
49 |
HF_TOKEN=""
|
50 |
|
51 |
# payload samples
|
52 |
+
regular_payload = { "inputs": "Coming to The Rescue Got a unique problem? Not to worry: you can find a financial planner for every specialized need"}
|
53 |
|
54 |
# HTTP headers for authorization
|
55 |
headers= {
|
|
|
62 |
classified = response.json()
|
63 |
|
64 |
print(classified)
|
65 |
+
# [ { "label": "World", "score": 0.12341519122860946 }, { "label": "Sports", "score": 0.11741269832494523 }, { "label": "Business", "score": 0.6124446065942992 }, { "label": "Sci/Tech", "score": 0.14672750385214603 } ]
|
66 |
```
|
67 |
|
68 |
|
|
|
70 |
**curl example**
|
71 |
|
72 |
```bash
|
73 |
+
curl https://YOURDOMAIN.us-east-1.aws.endpoints.huggingface.cloud \
|
74 |
-X POST \
|
75 |
+
-d '{"inputs": "Coming to The Rescue Got a unique problem? Not to worry: you can find a financial planner for every specialized need"}' \
|
76 |
-H "Authorization: Bearer XXX" \
|
77 |
+
-H "Content-Type: application/json"
|
78 |
```
|