shamblett / huggingface_client

A Hugging Face server and browser based REST API client for the inference and inference endpoint API's
MIT License
8 stars 2 forks source link

hugging face show some internal error while runnig feature extraction example in hugging face #11

Open huzaifansari54 opened 1 month ago

huzaifansari54 commented 1 month ago

final input = 'A string of text from which to extract the features.'; final params = ApiQueryNLPFeatureExtraction( inputs: [input], options: InferenceOptions(waitForModel: true)); final result = await apiInstance.queryNLPFeatureExtraction( taskParameters: params, model: 'sentence-transformers/paraphrase-xlm-r-multilingual-v1'); if (result!.isNotEmpty) { for (final row in result) { print(row?.representationFeatures); } } else { print('Inference task API Feature Extraction returned empty result'); }

while runnig this code i get this error ApiException 400: {"error":["Input should be a valid dictionary or instance of SentenceSimilarityInputsCheck: received ['A string of text from which to extract the features.'] in parameters"]})

i think hugging face api changes their parameters I also checked the text generation api it is also not work, could you suggest how to solve this?

shamblett commented 1 month ago

Looks as though Hugging face have changed their parameters as you suggest, this is a bit naughty as it causes breakage for everybody, they should really version their interfaces to stop this. s far as I know this is only solvable by a package update.

huzaifansari54 commented 1 month ago

can u suggest me how to solve this issue?

shamblett commented 1 month ago

Yes, as I've said above it needs a code change in the package to fix this. Feel free to raise a pull request if you wish.

huzaifansari54 commented 1 month ago

i solve it actually i dont know but we use wrong model thats why we get wrong parameters error use this mode facebook/bart-base i thing we should givepre define list of models so devloper use it like for image to text we give list o working models what you things

shamblett commented 1 month ago

Great thanks, I've applied a few very minor edits but otherwise fine. Package re released at version 1.3.0