Download tests/run_api_single_request.py from Jdbbd/Rwkv-xd: direct link, hf CLI and curl.
- Browser
- Download file 459 Bytes
-
https://huggingface.co/spaces/Jdbbd/Rwkv-xd/resolve/main/tests/run_api_single_request.py
- Command line
-
hf download hf://spaces/Jdbbd/Rwkv-xd/tests/run_api_single_request.py
-
curl -L -o run_api_single_request.py https://huggingface.co/spaces/Jdbbd/Rwkv-xd/resolve/main/tests/run_api_single_request.py
459 Bytes
| import os, sys | |
| sys.path.append(os.getcwd()) | |
| from app import chat_completions, ChatCompletionRequest | |
| import asyncio | |
| async def main(): | |
| req = ChatCompletionRequest(model='rwkv-latest', prompt='Who is the current president of France?', stream=False, max_tokens=32, temperature=0.2, include_usage=True, web_search=None, auto_web_search=True) | |
| res = await chat_completions(req) | |
| print(res) | |
| if __name__ == '__main__': | |
| asyncio.run(main()) | |