TillCyrill
commited on
Commit
•
dea771b
1
Parent(s):
2a27b42
from gradio demo
Browse files- Dockerfile +10 -10
- 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 |
-
|
63 |
-
#COPY --chown=user . $HOME/app
|
64 |
#
|
65 |
-
#CMD ["
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
-
|
130 |
-
gr.
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
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()
|