fix imports
Browse files- app.py +1 -8
- requirements.txt +10 -8
app.py
CHANGED
@@ -1,10 +1,3 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
def greet(name):
|
4 |
-
return "Hello " + name + "!!"
|
5 |
-
|
6 |
-
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
-
demo.launch()
|
8 |
from fastapi import FastAPI, HTTPException
|
9 |
from pydantic import BaseModel
|
10 |
import spaces # Necessary for the @spaces.GPU decorator
|
@@ -113,7 +106,7 @@ class PredictRequest(BaseModel):
|
|
113 |
# Add FastAPI routes
|
114 |
@app.get("/")
|
115 |
def read_root():
|
116 |
-
return {"Hello World"}
|
117 |
|
118 |
@app.post("/api/predict")
|
119 |
async def predict(request: PredictRequest):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
from fastapi import FastAPI, HTTPException
|
2 |
from pydantic import BaseModel
|
3 |
import spaces # Necessary for the @spaces.GPU decorator
|
|
|
106 |
# Add FastAPI routes
|
107 |
@app.get("/")
|
108 |
def read_root():
|
109 |
+
return {"Hello": "World"}
|
110 |
|
111 |
@app.post("/api/predict")
|
112 |
async def predict(request: PredictRequest):
|
requirements.txt
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
-
fastapi
|
2 |
-
uvicorn
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
|
|
|
|
|
1 |
+
fastapi
|
2 |
+
uvicorn
|
3 |
+
transformers
|
4 |
+
spaces
|
5 |
+
diffusers
|
6 |
+
torch
|
7 |
+
boto3
|
8 |
+
python-dotenv
|
9 |
+
Pillow
|
10 |
+
accelerate
|