Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /amphetamarina_litellm /tests /llm_translation /test_cloudflare.py
| import os | |
| import sys | |
| import traceback | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| import io | |
| import os | |
| sys.path.insert( | |
| 0, os.path.abspath("../..") | |
| ) # Adds the parent directory to the system path | |
| import json | |
| import pytest | |
| import litellm | |
| from litellm import RateLimitError, Timeout, completion, completion_cost, embedding | |
| # Cloud flare AI test | |
| async def test_completion_cloudflare(stream): | |
| try: | |
| litellm.set_verbose = False | |
| response = await litellm.acompletion( | |
| model="cloudflare/@cf/meta/llama-2-7b-chat-int8", | |
| messages=[{"content": "what llm are you", "role": "user"}], | |
| max_tokens=15, | |
| stream=stream, | |
| ) | |
| print(response) | |
| if stream is True: | |
| async for chunk in response: | |
| print(chunk) | |
| else: | |
| print(response) | |
| except Exception as e: | |
| pytest.fail(f"Error occurred: {e}") | |
Xet Storage Details
- Size:
- 997 Bytes
- Xet hash:
- 4ae2529f793135d62e09b466793c0a768ef0f77844303ef16635dabdc75dd61d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.