abrah926 commited on
Commit
36f1be7
Β·
verified Β·
1 Parent(s): 94a52b9

add embedding ui

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
  from datasets import load_dataset
 
4
 
5
  # βœ… Load the datasets
6
  datasets = {
@@ -67,6 +68,22 @@ demo = gr.ChatInterface(
67
  ],
68
  )
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  # Launch Gradio app
71
  if __name__ == "__main__":
72
  demo.launch()
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
  from datasets import load_dataset
4
+ import time
5
 
6
  # βœ… Load the datasets
7
  datasets = {
 
68
  ],
69
  )
70
 
71
+ def start_embedding():
72
+ # Include your embedding logic here (from embeddings.py)
73
+ log("Embedding started...")
74
+ time.sleep(2) # Simulating embedding process
75
+ log("Embedding process finished.")
76
+
77
+ # Create Gradio interface with a button to start the embedding
78
+ demo = gr.Interface(
79
+ fn=start_embedding,
80
+ inputs=None,
81
+ outputs="text",
82
+ live=True,
83
+ title="Embedding Trigger"
84
+ )
85
+
86
+
87
  # Launch Gradio app
88
  if __name__ == "__main__":
89
  demo.launch()