Spaces:
Running
on
Zero
Running
on
Zero
build: add @spaces.GPU decorator
Browse files- app.py +2 -1
- pyproject.toml +1 -0
- requirements.txt +2 -1
- uv.lock +28 -9
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
import os
|
@@ -226,7 +227,7 @@ def create_inference_config(
|
|
226 |
final_cfg = OmegaConf.merge(base_cfg, cfg_overrides)
|
227 |
return final_cfg
|
228 |
|
229 |
-
|
230 |
def predict_peptides(input_file, decoding_method):
|
231 |
"""
|
232 |
Main function to load data, run prediction, and return results.
|
|
|
1 |
+
import spaces
|
2 |
import gradio as gr
|
3 |
import torch
|
4 |
import os
|
|
|
227 |
final_cfg = OmegaConf.merge(base_cfg, cfg_overrides)
|
228 |
return final_cfg
|
229 |
|
230 |
+
@spaces.GPU
|
231 |
def predict_peptides(input_file, decoding_method):
|
232 |
"""
|
233 |
Main function to load data, run prediction, and return results.
|
pyproject.toml
CHANGED
@@ -8,6 +8,7 @@ dependencies = [
|
|
8 |
"gradio>=5.23.1",
|
9 |
"gradio-log>=0.0.8",
|
10 |
"instanovo>=1.1.0",
|
|
|
11 |
"torch==2.4.1",
|
12 |
]
|
13 |
|
|
|
8 |
"gradio>=5.23.1",
|
9 |
"gradio-log>=0.0.8",
|
10 |
"instanovo>=1.1.0",
|
11 |
+
"spaces>=0.34.0",
|
12 |
"torch==2.4.1",
|
13 |
]
|
14 |
|
requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
gradio>=5.23.1
|
2 |
gradio-log>=0.0.8
|
3 |
-
instanovo[cu124]>=1.1.0
|
|
|
|
1 |
gradio>=5.23.1
|
2 |
gradio-log>=0.0.8
|
3 |
+
instanovo[cu124]>=1.1.0
|
4 |
+
spaces>=0.34.0
|
uv.lock
CHANGED
@@ -857,6 +857,7 @@ dependencies = [
|
|
857 |
{ name = "gradio" },
|
858 |
{ name = "gradio-log" },
|
859 |
{ name = "instanovo" },
|
|
|
860 |
{ name = "torch", version = "2.4.1", source = { registry = "https://download.pytorch.org/whl/cu124" }, marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
|
861 |
{ name = "torch", version = "2.4.1", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'linux' and sys_platform != 'win32'" },
|
862 |
{ name = "torch", version = "2.4.1+cu124", source = { registry = "https://download.pytorch.org/whl/cu124" }, marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or sys_platform == 'win32'" },
|
@@ -867,6 +868,7 @@ requires-dist = [
|
|
867 |
{ name = "gradio", specifier = ">=5.23.1" },
|
868 |
{ name = "gradio-log", specifier = ">=0.0.8" },
|
869 |
{ name = "instanovo", specifier = ">=1.1.0" },
|
|
|
870 |
{ name = "torch", marker = "sys_platform != 'linux' and sys_platform != 'win32'", specifier = "==2.4.1" },
|
871 |
{ name = "torch", marker = "sys_platform == 'linux' or sys_platform == 'win32'", specifier = "==2.4.1", index = "https://download.pytorch.org/whl/cu124" },
|
872 |
]
|
@@ -1786,17 +1788,16 @@ wheels = [
|
|
1786 |
|
1787 |
[[package]]
|
1788 |
name = "psutil"
|
1789 |
-
version = "
|
1790 |
source = { registry = "https://pypi.org/simple" }
|
1791 |
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
1792 |
wheels = [
|
1793 |
-
{ url = "https://files.pythonhosted.org/packages/
|
1794 |
-
{ url = "https://files.pythonhosted.org/packages/
|
1795 |
-
{ url = "https://files.pythonhosted.org/packages/
|
1796 |
-
{ url = "https://files.pythonhosted.org/packages/
|
1797 |
-
{ url = "https://files.pythonhosted.org/packages/
|
1798 |
-
{ url = "https://files.pythonhosted.org/packages/
|
1799 |
-
{ url = "https://files.pythonhosted.org/packages/50/1b/6921afe68c74868b4c9fa424dad3be35b095e16687989ebbb50ce4fceb7c/psutil-7.0.0-cp37-abi3-win_amd64.whl", hash = "sha256:4cf3d4eb1aa9b348dec30105c55cd9b7d4629285735a102beb4441e38db90553", size = 244885 },
|
1800 |
]
|
1801 |
|
1802 |
[[package]]
|
@@ -2418,6 +2419,24 @@ wheels = [
|
|
2418 |
{ url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235 },
|
2419 |
]
|
2420 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2421 |
[[package]]
|
2422 |
name = "sparsestack"
|
2423 |
version = "0.6.4"
|
|
|
857 |
{ name = "gradio" },
|
858 |
{ name = "gradio-log" },
|
859 |
{ name = "instanovo" },
|
860 |
+
{ name = "spaces" },
|
861 |
{ name = "torch", version = "2.4.1", source = { registry = "https://download.pytorch.org/whl/cu124" }, marker = "platform_machine == 'aarch64' and sys_platform == 'linux'" },
|
862 |
{ name = "torch", version = "2.4.1", source = { registry = "https://pypi.org/simple" }, marker = "sys_platform != 'linux' and sys_platform != 'win32'" },
|
863 |
{ name = "torch", version = "2.4.1+cu124", source = { registry = "https://download.pytorch.org/whl/cu124" }, marker = "(platform_machine != 'aarch64' and sys_platform == 'linux') or sys_platform == 'win32'" },
|
|
|
868 |
{ name = "gradio", specifier = ">=5.23.1" },
|
869 |
{ name = "gradio-log", specifier = ">=0.0.8" },
|
870 |
{ name = "instanovo", specifier = ">=1.1.0" },
|
871 |
+
{ name = "spaces", specifier = ">=0.34.0" },
|
872 |
{ name = "torch", marker = "sys_platform != 'linux' and sys_platform != 'win32'", specifier = "==2.4.1" },
|
873 |
{ name = "torch", marker = "sys_platform == 'linux' or sys_platform == 'win32'", specifier = "==2.4.1", index = "https://download.pytorch.org/whl/cu124" },
|
874 |
]
|
|
|
1788 |
|
1789 |
[[package]]
|
1790 |
name = "psutil"
|
1791 |
+
version = "5.9.8"
|
1792 |
source = { registry = "https://pypi.org/simple" }
|
1793 |
+
sdist = { url = "https://files.pythonhosted.org/packages/90/c7/6dc0a455d111f68ee43f27793971cf03fe29b6ef972042549db29eec39a2/psutil-5.9.8.tar.gz", hash = "sha256:6be126e3225486dff286a8fb9a06246a5253f4c7c53b475ea5f5ac934e64194c", size = 503247 }
|
1794 |
wheels = [
|
1795 |
+
{ url = "https://files.pythonhosted.org/packages/e7/e3/07ae864a636d70a8a6f58da27cb1179192f1140d5d1da10886ade9405797/psutil-5.9.8-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:aee678c8720623dc456fa20659af736241f575d79429a0e5e9cf88ae0605cc81", size = 248702 },
|
1796 |
+
{ url = "https://files.pythonhosted.org/packages/b3/bd/28c5f553667116b2598b9cc55908ec435cb7f77a34f2bff3e3ca765b0f78/psutil-5.9.8-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:8cb6403ce6d8e047495a701dc7c5bd788add903f8986d523e3e20b98b733e421", size = 285242 },
|
1797 |
+
{ url = "https://files.pythonhosted.org/packages/c5/4f/0e22aaa246f96d6ac87fe5ebb9c5a693fbe8877f537a1022527c47ca43c5/psutil-5.9.8-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d06016f7f8625a1825ba3732081d77c94589dca78b7a3fc072194851e88461a4", size = 288191 },
|
1798 |
+
{ url = "https://files.pythonhosted.org/packages/6e/f5/2aa3a4acdc1e5940b59d421742356f133185667dd190b166dbcfcf5d7b43/psutil-5.9.8-cp37-abi3-win32.whl", hash = "sha256:bc56c2a1b0d15aa3eaa5a60c9f3f8e3e565303b465dbf57a1b730e7a2b9844e0", size = 251252 },
|
1799 |
+
{ url = "https://files.pythonhosted.org/packages/93/52/3e39d26feae7df0aa0fd510b14012c3678b36ed068f7d78b8d8784d61f0e/psutil-5.9.8-cp37-abi3-win_amd64.whl", hash = "sha256:8db4c1b57507eef143a15a6884ca10f7c73876cdf5d51e713151c1236a0e68cf", size = 255090 },
|
1800 |
+
{ url = "https://files.pythonhosted.org/packages/05/33/2d74d588408caedd065c2497bdb5ef83ce6082db01289a1e1147f6639802/psutil-5.9.8-cp38-abi3-macosx_11_0_arm64.whl", hash = "sha256:d16bbddf0693323b8c6123dd804100241da461e41d6e332fb0ba6058f630f8c8", size = 249898 },
|
|
|
1801 |
]
|
1802 |
|
1803 |
[[package]]
|
|
|
2419 |
{ url = "https://files.pythonhosted.org/packages/e9/44/75a9c9421471a6c4805dbf2356f7c181a29c1879239abab1ea2cc8f38b40/sniffio-1.3.1-py3-none-any.whl", hash = "sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2", size = 10235 },
|
2420 |
]
|
2421 |
|
2422 |
+
[[package]]
|
2423 |
+
name = "spaces"
|
2424 |
+
version = "0.34.0"
|
2425 |
+
source = { registry = "https://pypi.org/simple" }
|
2426 |
+
dependencies = [
|
2427 |
+
{ name = "gradio" },
|
2428 |
+
{ name = "httpx" },
|
2429 |
+
{ name = "packaging" },
|
2430 |
+
{ name = "psutil" },
|
2431 |
+
{ name = "pydantic" },
|
2432 |
+
{ name = "requests" },
|
2433 |
+
{ name = "typing-extensions" },
|
2434 |
+
]
|
2435 |
+
sdist = { url = "https://files.pythonhosted.org/packages/b6/5e/4bf8aefd36f7749d97b5be38b38f1c70f2b7a6d50d7a743e40a154bbbb72/spaces-0.34.0.tar.gz", hash = "sha256:cf19ee993b43cb7e7c495cb7c0274d776359e833064efb88788ea05a121919ec", size = 23158 }
|
2436 |
+
wheels = [
|
2437 |
+
{ url = "https://files.pythonhosted.org/packages/1d/d6/638db282a18c12f1f02a966cfdb3fe06a127cf3e81b148364402534621a4/spaces-0.34.0-py3-none-any.whl", hash = "sha256:a46a32026ffa9c8809632b296205806eaff0b97ea2295c334d43ac72e75f450a", size = 29693 },
|
2438 |
+
]
|
2439 |
+
|
2440 |
[[package]]
|
2441 |
name = "sparsestack"
|
2442 |
version = "0.6.4"
|