TillCyrill commited on
Commit
dea771b
1 Parent(s): 2a27b42

from gradio demo

Browse files
Files changed (2) hide show
  1. Dockerfile +10 -10
  2. main.py +27 -22
Dockerfile CHANGED
@@ -51,18 +51,18 @@ ENV PYTHONPATH="$AMBERHOME/lib/python3.10/site-packages"
51
  #COPY --chown=user . $HOME/app
52
 
53
 
54
- RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser .
55
-
56
- USER appuser
57
- CMD pwd
58
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
59
-
60
- #WORKDIR $HOME/app
61
  #
62
- ## Copy the current directory contents into the container at $HOME/app setting the owner to the user
63
- #COPY --chown=user . $HOME/app
64
  #
65
- #CMD ["python", "app.py"]
 
 
 
 
 
 
 
66
 
67
 
68
 
 
51
  #COPY --chown=user . $HOME/app
52
 
53
 
54
+ #RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser .
 
 
 
 
 
 
55
  #
56
+ #USER appuser
 
57
  #
58
+ #CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
59
+
60
+ WORKDIR $HOME/app
61
+
62
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
63
+ COPY --chown=user . $HOME/app
64
+
65
+ CMD ["python", "main.py"]
66
 
67
 
68
 
main.py CHANGED
@@ -126,25 +126,30 @@ def predict(pdb_code, pdb_file):
126
 
127
  callback = gr.CSVLogger()
128
 
129
- with gr.Blocks() as demo:
130
- gr.Markdown("# Protein Adaptability Prediction")
131
-
132
- #text_input = gr.Textbox()
133
- #text_output = gr.Textbox()
134
- #text_button = gr.Button("Flip")
135
- inp = gr.Textbox(placeholder="PDB Code or upload file below", label="Input structure")
136
- pdb_file = gr.File(label="PDB File Upload")
137
- #with gr.Row():
138
- # helix = gr.ColorPicker(label="helix")
139
- # sheet = gr.ColorPicker(label="sheet")
140
- # loop = gr.ColorPicker(label="loop")
141
- single_btn = gr.Button(label="Run")
142
- with gr.Row():
143
- html = gr.HTML()
144
- with gr.Row():
145
- dataframe = gr.Dataframe()
146
-
147
- single_btn.click(fn=predict, inputs=[inp, pdb_file], outputs=[html, dataframe])
148
-
149
-
150
- demo.launch(debug=True)
 
 
 
 
 
 
126
 
127
  callback = gr.CSVLogger()
128
 
129
+ def run():
130
+ with gr.Blocks() as demo:
131
+ gr.Markdown("# Protein Adaptability Prediction")
132
+
133
+ #text_input = gr.Textbox()
134
+ #text_output = gr.Textbox()
135
+ #text_button = gr.Button("Flip")
136
+ inp = gr.Textbox(placeholder="PDB Code or upload file below", label="Input structure")
137
+ pdb_file = gr.File(label="PDB File Upload")
138
+ #with gr.Row():
139
+ # helix = gr.ColorPicker(label="helix")
140
+ # sheet = gr.ColorPicker(label="sheet")
141
+ # loop = gr.ColorPicker(label="loop")
142
+ single_btn = gr.Button(label="Run")
143
+ with gr.Row():
144
+ html = gr.HTML()
145
+ with gr.Row():
146
+ dataframe = gr.Dataframe()
147
+
148
+ single_btn.click(fn=predict, inputs=[inp, pdb_file], outputs=[html, dataframe])
149
+
150
+
151
+ demo.launch(debug=True)
152
+
153
+
154
+ if __name__ == "__main__":
155
+ run()