Spaces:
Paused
Paused
Download main.py from zenotaiz/trojan-engine-node: direct link, hf CLI and curl.
- Browser
- Download file 721 Bytes
-
https://huggingface.co/spaces/zenotaiz/trojan-engine-node/resolve/main/main.py
- Command line
-
hf download hf://spaces/zenotaiz/trojan-engine-node/main.py
-
curl -L -o main.py https://huggingface.co/spaces/zenotaiz/trojan-engine-node/resolve/main/main.py
721 Bytes
| from fastapi import FastAPI | |
| import math | |
| import time | |
| app = FastAPI() | |
| def read_root(): | |
| return {"status": "awake", "message": "The 16GB Engine is hot."} | |
| def do_heavy_math(): | |
| start_time = time.time() | |
| primes = [] | |
| for num in range(2, 50000): | |
| is_prime = True | |
| for i in range(2, int(math.sqrt(num)) + 1): | |
| if (num % i) == 0: | |
| is_prime = False | |
| break | |
| if is_prime: | |
| primes.append(num) | |
| end_time = time.time() | |
| return { | |
| "message": "Heavy job complete in Python", | |
| "primes_found": len(primes), | |
| "seconds_taken": round(end_time - start_time, 2) | |
| } | |