Skip to content

Commit 2782e6b

Browse files
committed
nit
1 parent 3e2d49e commit 2782e6b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/api-inference/register-as-a-provider.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ class MyNewProviderTaskProviderHelper(TaskProviderHelper):
336336
### 3. Add tests
337337
- Go to [tests/test_inference_providers.py](https://github.com/huggingface/huggingface_hub/blob/main/tests/test_inference_providers.py) and add static tests for overridden methods.
338338
- Go to [tests/test_inference_client.py](https://github.com/huggingface/huggingface_hub/blob/main/tests/test_inference_client.py) and add VCR tests:
339+
339340
a. Add an entry to `_RECOMMENDED_MODELS_FOR_VCR` at the top of the test module. This contains a mapping task <> test model. model-id must be the HF model id.
340341
```python
341342
_RECOMMENDED_MODELS_FOR_VCR = {
@@ -346,6 +347,7 @@ class MyNewProviderTaskProviderHelper(TaskProviderHelper):
346347
...
347348
}
348349
```
350+
349351
b. Set up authentication: To record VCR cassettes, you'll need authentication:
350352
If you are a member of the provider organization (e.g., Replicate organization: https://huggingface.co/replicate), you can set the HF_INFERENCE_TEST_TOKEN environment variable with your HF token:
351353

@@ -360,6 +362,7 @@ class MyNewProviderTaskProviderHelper(TaskProviderHelper):
360362
```bash
361363
pytest tests/test_inference_client.py -k <provider>
362364
```
365+
363366
d. Commit the generated VCR cassettes with your PR.
364367

365368

0 commit comments

Comments
 (0)