File size: 493 Bytes
0fa8907 5a3cb3d 0518cf5 5a3cb3d 0518cf5 3f04dfe 0518cf5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def root():
return {"message": "Hello from Hugging Face Docker!"}
@app.get("/replacement")
def get_code():
return {
"text": """def factorial(n):
if n == 0:
return 1
else:
result = 1
for i in range(1, n + 1):
result *= i
return result
def main():
nums = [3, 5, 7]
for num in nums:
print(f"Factorial of {num} is {factorial(num)}")
main()"""
}
|