Update main.py
Browse files
main.py
CHANGED
@@ -4,8 +4,12 @@ from fastapi.responses import JSONResponse
|
|
4 |
|
5 |
app = FastAPI()
|
6 |
|
|
|
|
|
|
|
|
|
7 |
@app.get("/v1/models")
|
8 |
-
async def
|
9 |
url = 'https://huggingface.co/models-json?inference=warm&sort=trending&withCount=true'
|
10 |
async with aiohttp.ClientSession() as session:
|
11 |
async with session.get(url) as response:
|
|
|
4 |
|
5 |
app = FastAPI()
|
6 |
|
7 |
+
@app.get('/')
|
8 |
+
async def homepage():
|
9 |
+
return "Request or go to /v1/models to use the space, make sure its a GET"
|
10 |
+
|
11 |
@app.get("/v1/models")
|
12 |
+
async def main():
|
13 |
url = 'https://huggingface.co/models-json?inference=warm&sort=trending&withCount=true'
|
14 |
async with aiohttp.ClientSession() as session:
|
15 |
async with session.get(url) as response:
|