Spaces:
Running
Running
prithivMLmods
commited on
Commit
•
b7d45be
1
Parent(s):
651e86e
Update pythonproject.py
Browse files- pythonproject.py +19 -0
pythonproject.py
CHANGED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fastapi import FastAPI
|
2 |
+
from fastapi.middleware.cors import CORSMiddleware
|
3 |
+
import gradio as gr
|
4 |
+
|
5 |
+
def image_generator(prompt):
|
6 |
+
pass
|
7 |
+
|
8 |
+
interface = gr.Interface(fn=image_generator, inputs="text", outputs="image")
|
9 |
+
app = FastAPI()
|
10 |
+
|
11 |
+
app.add_middleware(
|
12 |
+
CORSMiddleware,
|
13 |
+
allow_origins=["*"],
|
14 |
+
allow_credentials=True,
|
15 |
+
allow_methods=["*"],
|
16 |
+
allow_headers=["*"],
|
17 |
+
)
|
18 |
+
|
19 |
+
app = gr.mount_gradio_app(app, interface, path="/")
|