Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

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,

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants