Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixes #4182: The huggingface examples return strange results #4190

Merged
merged 2 commits into from
Oct 7, 2024

Conversation

vga91
Copy link
Collaborator

@vga91 vga91 commented Sep 18, 2024

Fixes #4182

With gpt2 and similar, the answers are not always valid.
Changed test case to google-bert/bert-base-uncased

Added PATH_CONF_KEY and METHOD_KEY as optional configurations, if not present, since some models fail with method: 'GET',

and the path: '' causes a fail or an incorrect result depending on the model.

@@ -161,10 +161,12 @@ For the https://huggingface.co/[HuggingFace API], we have to define the config `
For example:
[source,cypher]
----
CALL apoc.ml.openai.completion('What color is the sky? Answer in one word: ', $huggingFaceApiKey,
{endpoint: 'https://api-inference.huggingface.co/models/gpt2', apiType: 'HUGGINGFACE', model: 'gpt2', path: ''})
CALL apoc.ml.openai.completion('The sky has a [MASK] color', $huggingFaceApiKey,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[MASK] is the color of the sky

@RobertoSannino RobertoSannino merged commit 9c9e015 into dev Oct 7, 2024
5 checks passed
@RobertoSannino RobertoSannino deleted the issue-4182 branch October 7, 2024 08:41
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants