Efficient distributed inference.
Project description
example_usage.py
import asyncio
import time
from esotericai.circuit import CircuitForBatchProcessing
async def task(circuit, id):
conv = [
{
"role": "user",
"content": f"Hello! Please use number {id} in your responce."
}
]
result = await circuit.chat(["llama8b"], conv)
print(f"Task {id}/1 done:" + str(result))
start_time = time.time()
CircuitForBatchProcessing.dispatch(
job_name="my_chat_job",
task_func=task,
num_tasks=5,
api_url="127.0.0.1:6325" # Nexus IP adress
)
end_time = time.time()
print(f"Total time taken: {end_time - start_time:.2f} seconds")
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
esotericai-0.0.4.tar.gz
(5.0 kB
view details)
File details
Details for the file esotericai-0.0.4.tar.gz.
File metadata
- Download URL: esotericai-0.0.4.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c54d534fc8fa8f92e5c9986322668149958ce766e0ae032d3e1f9ff669f2aef4
|
|
| MD5 |
2174cb556b58e1ff1c9b465d7b7e8fb5
|
|
| BLAKE2b-256 |
ac4a45ab297dcb209d7665c703a0f71cb405943f17641dec995e539d39809537
|