Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,8 +7,7 @@ app = FastAPI()
|
|
| 7 |
|
| 8 |
@spaces.GPU
|
| 9 |
def embed(text):
|
| 10 |
-
|
| 11 |
-
pass
|
| 12 |
|
| 13 |
@app.post("/v1/embeddings")
|
| 14 |
def openai_embed(req:Request):
|
|
@@ -22,5 +21,16 @@ with gr.Blocks() as demo:
|
|
| 22 |
|
| 23 |
text.submit(embed, [text], [embeddings]);
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
GradioApp = gr.mount_gradio_app(app, demo, path="/");
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
@spaces.GPU
|
| 9 |
def embed(text):
|
| 10 |
+
return [0,1,2,3];
|
|
|
|
| 11 |
|
| 12 |
@app.post("/v1/embeddings")
|
| 13 |
def openai_embed(req:Request):
|
|
|
|
| 21 |
|
| 22 |
text.submit(embed, [text], [embeddings]);
|
| 23 |
|
| 24 |
+
|
| 25 |
+
print("Demo run...");
|
| 26 |
+
(app2,url,other) = demo.launch(prevent_thread_lock=True, server_name=None, server_port=8000);
|
| 27 |
+
|
| 28 |
GradioApp = gr.mount_gradio_app(app, demo, path="/");
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
demo.close();
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
if __name__ == '__main__':
|
| 35 |
+
print("Running uviconr...");
|
| 36 |
+
uvicorn.run(GradioApp, host="0.0.0.0", port=7860)
|