Commit 900a895
authored
[InferenceSnippets] Fix HF_TOKEN not used if https:// in example (#1535)
I was using a condition a bit dirty to check whether the `HF_TOKEN` or
the provider token should be used (based on presence of `https://` in
the example). This PR makes the condition more robust by checking the
presence of `InferenceClient` instead.
**Expectation:**
https://huggingface.co/Qwen/Qwen2.5-VL-32B-Instruct?inference_api=true&inference_provider=fireworks-ai&language=python
should use `HF_TOKEN` instead of
`api_key=os.environ["FIREWORKS_AI_API_KEY"],`.
thanks @Vaibhavs10 for
[flagging](https://huggingface.slack.com/archives/C089DMDB415/p1749822922352309)
(private slack)1 parent 76770d7 commit 900a895
File tree
5 files changed
+5
-5
lines changed- packages
- inference/src/snippets
- tasks-gen/snippets-fixtures
- conversational-vlm-non-stream
- js/huggingface.js
- python/huggingface_hub
- conversational-vlm-stream
- js/huggingface.js
- python/huggingface_hub
5 files changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | | - | |
| 469 | + | |
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
packages/tasks-gen/snippets-fixtures/conversational-vlm-stream/js/huggingface.js/0.fireworks-ai.js
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
0 commit comments