raja5259 commited on
Commit
c2f6a73
·
verified ·
1 Parent(s): 7d7ad0d

create app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+
3
+ import s23_openai_clip
4
+ import gradio as gr
5
+
6
+
7
+ _, valid_df = make_train_valid_dfs()
8
+ model, image_embeddings = get_image_embeddings(valid_df, "best.pt")
9
+
10
+ query_text = "dogs on the grass"
11
+
12
+
13
+ def greet(query_text):
14
+ return inference_CLIP(query_text)
15
+
16
+
17
+ demo = gr.Interface(fn=greet, inputs="text", outputs="text")
18
+ demo.launch("debug")