from fastapi import FastAPI | |
app = FastAPI() | |
def root(): | |
return {"message": "Hello from Hugging Face Docker!"} | |
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()""" | |
} | |