BioGeek commited on
Commit
85d497c
·
1 Parent(s): 2ae10d1

build: add @spaces.GPU decorator

Browse files
Files changed (4) hide show
  1. app.py +2 -1
  2. pyproject.toml +1 -0
  3. requirements.txt +2 -1
  4. 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 = "7.0.0"
1790
  source = { registry = "https://pypi.org/simple" }
1791
- sdist = { url = "https://files.pythonhosted.org/packages/2a/80/336820c1ad9286a4ded7e845b2eccfcb27851ab8ac6abece774a6ff4d3de/psutil-7.0.0.tar.gz", hash = "sha256:7be9c3eba38beccb6495ea33afd982a44074b78f28c434a1f51cc07fd315c456", size = 497003 }
1792
  wheels = [
1793
- { url = "https://files.pythonhosted.org/packages/ed/e6/2d26234410f8b8abdbf891c9da62bee396583f713fb9f3325a4760875d22/psutil-7.0.0-cp36-abi3-macosx_10_9_x86_64.whl", hash = "sha256:101d71dc322e3cffd7cea0650b09b3d08b8e7c4109dd6809fe452dfd00e58b25", size = 238051 },
1794
- { url = "https://files.pythonhosted.org/packages/04/8b/30f930733afe425e3cbfc0e1468a30a18942350c1a8816acfade80c005c4/psutil-7.0.0-cp36-abi3-macosx_11_0_arm64.whl", hash = "sha256:39db632f6bb862eeccf56660871433e111b6ea58f2caea825571951d4b6aa3da", size = 239535 },
1795
- { url = "https://files.pythonhosted.org/packages/2a/ed/d362e84620dd22876b55389248e522338ed1bf134a5edd3b8231d7207f6d/psutil-7.0.0-cp36-abi3-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1fcee592b4c6f146991ca55919ea3d1f8926497a713ed7faaf8225e174581e91", size = 275004 },
1796
- { url = "https://files.pythonhosted.org/packages/bf/b9/b0eb3f3cbcb734d930fdf839431606844a825b23eaf9a6ab371edac8162c/psutil-7.0.0-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b1388a4f6875d7e2aff5c4ca1cc16c545ed41dd8bb596cefea80111db353a34", size = 277986 },
1797
- { url = "https://files.pythonhosted.org/packages/eb/a2/709e0fe2f093556c17fbafda93ac032257242cabcc7ff3369e2cb76a97aa/psutil-7.0.0-cp36-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a5f098451abc2828f7dc6b58d44b532b22f2088f4999a937557b603ce72b1993", size = 279544 },
1798
- { url = "https://files.pythonhosted.org/packages/50/e6/eecf58810b9d12e6427369784efe814a1eec0f492084ce8eb8f4d89d6d61/psutil-7.0.0-cp37-abi3-win32.whl", hash = "sha256:ba3fcef7523064a6c9da440fc4d6bd07da93ac726b5733c29027d7dc95b39d99", size = 241053 },
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"