rrg92 commited on
Commit
6cd48e0
·
1 Parent(s): 9e32d29

fix gradio

Browse files
Files changed (1) hide show
  1. app.py +6 -13
app.py CHANGED
@@ -24,19 +24,6 @@ def embed(text):
24
  return query_embedding.tolist();
25
 
26
 
27
-
28
-
29
- with gr.Blocks(fill_height=True) as demo:
30
- text = gr.Textbox();
31
- embeddings = gr.Textbox()
32
-
33
- text.submit(embed, [text], [embeddings]);
34
-
35
-
36
-
37
-
38
-
39
-
40
  @app.post("/v1/embeddings")
41
  async def openai_embeddings(request: Request):
42
  body = await request.json();
@@ -58,6 +45,12 @@ async def openai_embeddings(request: Request):
58
  ,'total_tokens': 0
59
  }
60
  }
 
 
 
 
 
 
61
 
62
 
63
  print("Loading embedding model");
 
24
  return query_embedding.tolist();
25
 
26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  @app.post("/v1/embeddings")
28
  async def openai_embeddings(request: Request):
29
  body = await request.json();
 
45
  ,'total_tokens': 0
46
  }
47
  }
48
+
49
+ with gr.Blocks(fill_height=True) as demo:
50
+ text = gr.Textbox();
51
+ embeddings = gr.Textbox()
52
+
53
+ text.submit(embed, [text], [embeddings]);
54
 
55
 
56
  print("Loading embedding model");