Spaces:
Sleeping
Sleeping
Download server.py from AI-Infy/AI-application: direct link, hf CLI and curl.
- Browser
- Download file 498 Bytes
-
https://huggingface.co/spaces/AI-Infy/AI-application/resolve/main/server.py
- Command line
-
hf download hf://spaces/AI-Infy/AI-application/server.py
-
curl -L -o server.py https://huggingface.co/spaces/AI-Infy/AI-application/resolve/main/server.py
498 Bytes
| from fastapi import FastAPI, Depends | |
| import os | |
| import auth | |
| import client | |
| import model | |
| app = FastAPI() | |
| async def welcome(): | |
| return "Hello, Welcome to AI space!" | |
| async def generate(api_key = Depends(auth.api_key_auth)): | |
| return "All good. You only get this message if you're authenticated" | |
| async def generate(ticket: model.Ticket, api_key = Depends(auth.api_key_auth)): | |
| response = client.get_completion(ticket) | |
| return response |