check / app.py
navpan2's picture
Update app.py
0518cf5 verified
raw
history blame
493 Bytes
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()"""
}