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

completion() for fireworks #329

Merged
merged 1 commit into from
Oct 25, 2024
Merged

completion() for fireworks #329

merged 1 commit into from
Oct 25, 2024

Conversation

dineshyv
Copy link
Contributor

What does this PR do?

implements completetion() API for fireworks

Feature/Issue validation/testing/test plan

 PROVIDER_ID=test-fireworks MODEL_IDS="Llama3.1-8B-Instruct" PROVIDER_CONFIG=../configs/provider_config_example.yaml with-proxy pytest -s tests/inference/test_inference.py --tb=short --disable-warnings -rs
/home/dineshyv/.conda/envs/stack/lib/python3.10/site-packages/pytest_asyncio/plugin.py:208: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
================================================================================= test session starts =================================================================================
platform linux -- Python 3.10.15, pytest-8.3.3, pluggy-1.5.0
rootdir: /home/dineshyv/local/llama-stack
configfile: pyproject.toml
plugins: asyncio-0.24.0, anyio-4.6.2.post1
asyncio: mode=strict, default_loop_scope=None
collected 8 items

tests/inference/test_inference.py Resolved 4 providers
 inner-inference => test-fireworks
 models => __routing_table__
 inference => __autorouted__
 inspect => __builtin__

........

=========================================================================== 8 passed, 21 warnings in 9.24s ============================================================================

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 25, 2024
@dineshyv dineshyv linked an issue Oct 25, 2024 that may be closed by this pull request
@@ -167,7 +168,7 @@ async def test_completion(inference_settings):
]

assert all(isinstance(chunk, CompletionResponseStreamChunk) for chunk in chunks)
assert len(chunks) == 51
assert len(chunks) >= 1
Copy link
Contributor Author

@dineshyv dineshyv Oct 25, 2024

Choose a reason for hiding this comment

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

@ashwinb, this is needed since the number of chunks each provider returns is not consistent and does not depend on the max tokens.

Copy link
Contributor

@ashwinb ashwinb left a comment

Choose a reason for hiding this comment

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

sweet

@dineshyv dineshyv merged commit 9b85d9a into main Oct 25, 2024
4 checks passed
@dineshyv dineshyv deleted the dineshyv/fireworks-completion branch October 25, 2024 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[functionality] Implement completion() methods
3 participants