Open nastyabakhshieva opened 1 day ago
I removed the path from the generated client file using the openapi.json and ran it because of this issue.
It seems like I might need to get the latest version of the OpenAPI file from Hugging Face. (I haven’t fully analyzed it yet.)
As a temporary workaround, it works if remove the path in the URI component builder for the path.
Bug description I was experimenting on Spring AI and was looking for a free model for ChatApi implementation. Upon investigation I found I can use HuggingFace
microsoft/Phi-3-mini-4k-instruct
model. So, I added the following dependency in my project and started to investigate:Similarly, I added in application yaml:
Once done, I called
HuggingfaceChatModel
Unfortunately, The following exception was received:
What I found is that, /generate postfix is appended in the code & hardcoded in org.springframework.ai.huggingface.api.TextGenerationInferenceApi#generateWithHttpInfo, line 83 Whereas, with postman everything works as expected as per hugging face documentation - https://huggingface.co/docs/api-inference/tasks/text-generation?code=curl
Environment Java version - 21 Build tool - gradle 8.3 Spring AI version - 1.0.0-M3
Steps to reproduce Just a simple ChatClient setup with hugging face model provided along with access key generated in hugging face account
Expected behavior /generate is not hardcoded hence can put whatever url is needed
Minimal Complete Reproducible example I can't put my access key here, but all you need to do is