codeblacks commited on
Commit
0551a11
·
verified ·
1 Parent(s): cfccd27

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -10,14 +10,13 @@ def generate_embeddings(chunks):
10
  return embeddings.tolist() # Convert tensor to list for Gradio
11
 
12
  # Define the Gradio interface
13
- iface = gr.Interface(
14
  fn=generate_embeddings,
15
- inputs=gr.inputs.Textbox(lines=5, placeholder="Enter text chunks here..."),
16
- outputs=gr.outputs.JSON(),
17
  title="Sentence Transformer Embeddings",
18
  description="Generate embeddings for input text chunks."
19
  )
20
 
21
  # Launch the Gradio app
22
- if __name__ == "__main__":
23
- iface.launch()
 
10
  return embeddings.tolist() # Convert tensor to list for Gradio
11
 
12
  # Define the Gradio interface
13
+ interface = gr.Interface(
14
  fn=generate_embeddings,
15
+ inputs=gr.Textbox(lines=5, placeholder="Enter text chunks here..."),
16
+ outputs=gr.JSON(),
17
  title="Sentence Transformer Embeddings",
18
  description="Generate embeddings for input text chunks."
19
  )
20
 
21
  # Launch the Gradio app
22
+ interface.launch()