Spaces:
Running
Running
Download tests/rate_limiter_test.py from Leon4gr45/openoperator: direct link, hf CLI and curl.
- Browser
- Download file 668 Bytes
-
https://huggingface.co/spaces/Leon4gr45/openoperator/resolve/main/tests/rate_limiter_test.py
- Command line
-
hf download hf://spaces/Leon4gr45/openoperator/tests/rate_limiter_test.py
-
curl -L -o rate_limiter_test.py https://huggingface.co/spaces/Leon4gr45/openoperator/resolve/main/tests/rate_limiter_test.py
668 Bytes
| import sys, os | |
| sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
| import models | |
| provider = "openrouter" | |
| name = "deepseek/deepseek-r1" | |
| model = models.get_chat_model( | |
| provider=provider, | |
| name=name, | |
| model_config=models.ModelConfig( | |
| type=models.ModelType.CHAT, | |
| provider=provider, | |
| name=name, | |
| limit_requests = 5, | |
| limit_input = 15000, | |
| limit_output = 1000, | |
| ) | |
| ) | |
| async def run(): | |
| response, reasoning = await model.unified_call( | |
| user_message="Tell me a joke" | |
| ) | |
| print("Response: ", response) | |
| print("Reasoning: ", reasoning) | |
| import asyncio | |
| asyncio.run(run()) |