fmoorhof commited on
Commit
d29851a
·
1 Parent(s): 64ebfda

feat: add different pLMs as input

Browse files
Files changed (2) hide show
  1. README.md +2 -0
  2. app.py +10 -3
README.md CHANGED
@@ -11,3 +11,5 @@ short_description: 'input: protein sequences; output: embeddings'
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
14
+
15
+ Minimal example Gradio app for inputting protein sequences and outputting protein LLM embeddings.
app.py CHANGED
@@ -1,9 +1,16 @@
1
  import gradio as gr
2
  from embed import gen_embedding
3
 
4
- def generate_embeddings(sequences):
5
- embeddings = gen_embedding(sequences, plm_model="esm1b")
6
  return embeddings.tolist()
7
 
8
- demo = gr.Interface(fn=generate_embeddings, inputs="text", outputs="text")
 
 
 
 
 
 
 
9
  demo.launch()
 
1
  import gradio as gr
2
  from embed import gen_embedding
3
 
4
+ def generate_embeddings(sequences, plm_model):
5
+ embeddings = gen_embedding(sequences, plm_model=plm_model)
6
  return embeddings.tolist()
7
 
8
+ demo = gr.Interface(
9
+ fn=generate_embeddings,
10
+ inputs=[
11
+ "text",
12
+ gr.Dropdown(choices=["esm1b", "esm2", "prott5", "prostt5"], label="PLM Model")
13
+ ],
14
+ outputs="text"
15
+ )
16
  demo.launch()