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

The same response is generated for the same message #2764

Open
BokDan93 opened this issue Feb 27, 2025 · 1 comment
Open

The same response is generated for the same message #2764

BokDan93 opened this issue Feb 27, 2025 · 1 comment
Assignees
Labels
bug Something isn't working respond

Comments

@BokDan93
Copy link

Why do I generate the same response for the same message?
I figured out the images, I needed to register the seed. And in terms of text models, how can I apply randomization?
Where can I completely see all the parameters that I can apply to text generation?

Here's my code:

from g4f.client import Client as G4fClient
from g4f.Provider import DDG, Blackbox, IterListProvider

client = G4fClient(provider=IterListProvider([DDG, Blackbox]))

        model = "gpt-4o" if attempt % 2 == 1 else "gpt-4o-mini"
        try:
            loop = asyncio.get_running_loop()
            response = await asyncio.wait_for(
                loop.run_in_executor(
                    None,
                    lambda: clientFree.chat.completions.create(
                        model=model,
                        messages=[{"role": "user", "content": prompt}]
                    )
                ),
                timeout=TIMEOUT_SECONDS
            )
            response_str = response.choices[0].message.content
Image
@BokDan93 BokDan93 added the bug Something isn't working label Feb 27, 2025
@hlohaus
Copy link
Collaborator

hlohaus commented Feb 27, 2025

Provider parameters are accessible via print(g4f.Provider.DDG.params). Additionally, they are viewable within the user interface by selecting the provider name post-generation. The randomization parameter is identified as "seed". @BokDan93

@hlohaus hlohaus added question Further information is requested respond and removed question Further information is requested labels Feb 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working respond
Projects
None yet
Development

No branches or pull requests

3 participants