llama-stack/llama_stack/apis/common
Xi Yan 694adb1501
[bugfix] fix broken vision inference, change serialization for bytes (#693)
# What does this PR do?

- vision inference via image as binary bytes fails with serialization
error
- add custom serialization for "bytes" in `_URLOrData`

## Test Plan

```
pytest -v -s -k "fireworks" --inference-model="meta-llama/Llama-3.2-11B-Vision-Instruct" ./llama_stack/providers/tests/inference/test_vision_inference.py::TestVisionModelInference::test_vision_chat_completion_non_streaming
```

**Before**
<img width="1020" alt="image"
src="https://github.com/user-attachments/assets/3803fcee-32ee-4b8e-ba46-47848e1a6247"
/>


**After**
<img width="1018" alt="image"
src="https://github.com/user-attachments/assets/f3e3156e-88ce-40fd-ad1b-44b87f376e03"
/>

<img width="822" alt="image"
src="https://github.com/user-attachments/assets/1898696f-95c0-4694-8a47-8f51c7de0e86"
/>



## Sources

Please link relevant resources if necessary.


## Before submitting

- [ ] This PR fixes a typo or improves the docs (you can dismiss the
other checks if that's the case).
- [ ] Ran pre-commit to handle lint / formatting issues.
- [ ] Read the [contributor
guideline](https://github.com/meta-llama/llama-stack/blob/main/CONTRIBUTING.md),
      Pull Request section?
- [ ] Updated relevant documentation.
- [ ] Wrote necessary unit or integration tests.
2024-12-30 13:57:41 -08:00
..
__init__.py API Updates (#73) 2024-09-17 19:51:35 -07:00
content_types.py [bugfix] fix broken vision inference, change serialization for bytes (#693) 2024-12-30 13:57:41 -08:00
deployment_types.py Update the "InterleavedTextMedia" type (#635) 2024-12-17 11:18:31 -08:00
job_types.py [2/n][torchtune integration] implement job management and return training artifacts (#593) 2024-12-13 15:00:04 -08:00
training_types.py [2/n][torchtune integration] implement job management and return training artifacts (#593) 2024-12-13 15:00:04 -08:00
type_system.py Update the "InterleavedTextMedia" type (#635) 2024-12-17 11:18:31 -08:00