You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
582 B
27 lines
582 B
import os
|
|
import threading
|
|
from swarms.agents.multion_wrapper import MultiOnAgent
|
|
|
|
|
|
def run_model(api_key):
|
|
model = MultiOnAgent(
|
|
api_key=api_key, max_steps=500, url="https://x.com"
|
|
)
|
|
out = model.run("")
|
|
print(out)
|
|
|
|
|
|
# Create a list to store the threads
|
|
threads = []
|
|
|
|
# Run 100 instances using multithreading
|
|
for _ in range(10):
|
|
api_key = os.getenv("MULTION_API_KEY")
|
|
thread = threading.Thread(target=run_model, args=(api_key,))
|
|
thread.start()
|
|
threads.append(thread)
|
|
|
|
# Wait for all threads to finish
|
|
for thread in threads:
|
|
thread.join()
|