Skip to content

Commit dd80764

Browse files
committed
docs: PREINSTALL & POSTINSTALL
1 parent 110905a commit dd80764

File tree

3 files changed

+42
-31
lines changed

3 files changed

+42
-31
lines changed

extensions/firestore-huggingface-inference-api/POSTINSTALL.md

Lines changed: 38 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,44 @@
1-
# See it in action
1+
## See it in action
22

33
You can test out this extension right away!
44

5-
Visit the following URL:
6-
${function:greetTheWorld.url}
7-
8-
# Using the extension
9-
10-
When triggered by an HTTP request, this extension responds with the following specified greeting: "${param:GREETING} World from ${param:EXT_INSTANCE_ID}".
11-
12-
To learn more about HTTP functions, visit the [functions documentation](https://firebase.google.com/docs/functions/http-events).
13-
14-
<!-- We recommend keeping the following section to explain how to monitor extensions with Firebase -->
5+
Depending on the task you want to run, add a new Firestore document to `${param:collectionPath}`.
6+
7+
For example, if you want to run a text classification task using the model [`distilbert-base-uncased-finetuned-sst-2-english`](https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english), add a new document to `${param:collectionPath}` with the following fields:
8+
```
9+
{
10+
"inputs": "You're amazing!"
11+
}
12+
```
13+
14+
The response will get written back to the same document.
15+
16+
```
17+
{
18+
"inputs": "You're amazing!",
19+
"response": [
20+
{
21+
"label": "POSITIVE",
22+
"score": 0.9998762602806091
23+
},
24+
{
25+
"label": "NEGATIVE",
26+
"score": 0.00012373875781264198
27+
}
28+
]
29+
}
30+
```
31+
32+
## Error handling
33+
34+
If the extension encounters an error, it will write the error message to the document in `${param:collectionPath}`.
35+
36+
```
37+
{
38+
"text": "You're amazing!",
39+
"error": "Field `inputs` must be provided and must be a string or a list of strings"
40+
}
41+
```
1542

1643
# Monitoring
1744

extensions/firestore-huggingface-inference-api/PREINSTALL.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,11 @@ Use this extension to run inferences in a Firestore collection using the [Huggin
22

33
When triggered by a write operation in a Firestore document, this extension performs a Natural Language Processing task on a specified field and updates the document with the results.
44

5-
The extension supports both using Hugging Face Hosted Inference API and using a custom model hosted on your own server.
5+
The extension supports both using Hugging Face [Hosted Inference API](https://huggingface.co/docs/api-inference) and [Inference Endpoints](https://huggingface.co/docs/inference-endpoints/index).
66

77
## Supported tasks
88

9-
This extension **currently** supports the following Natural Language Processing tasks:
10-
- [Fill Mask](https://huggingface.co/docs/api-inference#fill-mask)
11-
- [Summarization](https://huggingface.co/docs/api-inference#summarization)
12-
- [Question Answering](https://huggingface.co/docs/api-inference/detailed_parameters#question-answering-task)
13-
- [Table Question Answering task](https://huggingface.co/docs/api-inference/detailed_parameters#table-question-answering-task)
14-
- [Sentence Similarity task](https://huggingface.co/docs/api-inference/detailed_parameters#sentence-similarity-task)
15-
- [Text Classification task](https://huggingface.co/docs/api-inference/detailed_parameters#text-classification-task)
16-
17-
For more information about the Hugging Face inference API, see the [documentation](https://huggingface.co/docs/api-inference).
9+
This extension **currently** supports all Natural Language Processing tasks that are supported by HuggingFace, [click here to see the full list of NLP tasks](https://huggingface.co/docs/api-inference).
1810

1911
# Billing
2012

extensions/firestore-huggingface-inference-api/README.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,11 @@
1010

1111
When triggered by a write operation in a Firestore document, this extension performs a Natural Language Processing task on a specified field and updates the document with the results.
1212

13-
The extension supports both using Hugging Face Hosted Inference API and using a custom model hosted on your own server.
13+
The extension supports both using Hugging Face [Hosted Inference API](https://huggingface.co/docs/api-inference) and [Inference Endpoints](https://huggingface.co/docs/inference-endpoints/index).
1414

1515
## Supported tasks
1616

17-
This extension **currently** supports the following Natural Language Processing tasks:
18-
- [Fill Mask](https://huggingface.co/docs/api-inference#fill-mask)
19-
- [Summarization](https://huggingface.co/docs/api-inference#summarization)
20-
- [Question Answering](https://huggingface.co/docs/api-inference/detailed_parameters#question-answering-task)
21-
- [Table Question Answering task](https://huggingface.co/docs/api-inference/detailed_parameters#table-question-answering-task)
22-
- [Sentence Similarity task](https://huggingface.co/docs/api-inference/detailed_parameters#sentence-similarity-task)
23-
- [Text Classification task](https://huggingface.co/docs/api-inference/detailed_parameters#text-classification-task)
24-
25-
For more information about the Hugging Face inference API, see the [documentation](https://huggingface.co/docs/api-inference).
17+
This extension **currently** supports all Natural Language Processing tasks that are supported by HuggingFace, [click here to see the full list of NLP tasks](https://huggingface.co/docs/api-inference).
2618

2719
# Billing
2820

0 commit comments

Comments
 (0)