freemt commited on
Commit
c015fd4
1 Parent(s): f42c9b2

Update sp test

Browse files
Files changed (5) hide show
  1. app.py +11 -3
  2. poetry.lock +8 -156
  3. pyproject.toml +1 -1
  4. requirements.txt +5 -0
  5. run-python-app_py.bat +1 -0
app.py CHANGED
@@ -1,8 +1,16 @@
1
- import httpx
 
 
2
  import gradio as gr
3
 
4
  def greet(name):
5
- return "Hello " + name + "!!"
 
 
 
 
 
 
6
 
7
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
8
- iface.launch()
 
1
+ # import httpx
2
+ import subprocess as sp
3
+ from shlex import split
4
  import gradio as gr
5
 
6
  def greet(name):
7
+ try:
8
+ # out = subprocess.check_output(["nvidia-smi", "-L"], encoding='utf8')
9
+ out = sp.check_output(split(name), encoding='utf8')
10
+ except Exception as e:
11
+ out = str(e)
12
+ # return "Hello " + name + "!!"
13
+ return f"[out: {out}]"
14
 
15
  iface = gr.Interface(fn=greet, inputs="text", outputs="text")
16
+ iface.launch(share=True, debug=True)
poetry.lock CHANGED
@@ -1,166 +1,18 @@
1
  [[package]]
2
- name = "anyio"
3
- version = "3.4.0"
4
- description = "High level compatibility layer for multiple asynchronous event loop implementations"
5
  category = "main"
6
  optional = false
7
- python-versions = ">=3.6.2"
8
-
9
- [package.dependencies]
10
- idna = ">=2.8"
11
- sniffio = ">=1.1"
12
- typing-extensions = {version = "*", markers = "python_version < \"3.8\""}
13
-
14
- [package.extras]
15
- doc = ["sphinx-rtd-theme", "sphinx-autodoc-typehints (>=1.2.0)"]
16
- test = ["coverage[toml] (>=4.5)", "hypothesis (>=4.0)", "pytest (>=6.0)", "pytest-mock (>=3.6.1)", "trustme", "contextlib2", "uvloop (<0.15)", "mock (>=4)", "uvloop (>=0.15)"]
17
- trio = ["trio (>=0.16)"]
18
-
19
- [[package]]
20
- name = "certifi"
21
- version = "2021.10.8"
22
- description = "Python package for providing Mozilla's CA Bundle."
23
- category = "main"
24
- optional = false
25
- python-versions = "*"
26
-
27
- [[package]]
28
- name = "charset-normalizer"
29
- version = "2.0.9"
30
- description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet."
31
- category = "main"
32
- optional = false
33
- python-versions = ">=3.5.0"
34
-
35
- [package.extras]
36
- unicode_backport = ["unicodedata2"]
37
-
38
- [[package]]
39
- name = "h11"
40
- version = "0.12.0"
41
- description = "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1"
42
- category = "main"
43
- optional = false
44
- python-versions = ">=3.6"
45
-
46
- [[package]]
47
- name = "httpcore"
48
- version = "0.14.3"
49
- description = "A minimal low-level HTTP client."
50
- category = "main"
51
- optional = false
52
- python-versions = ">=3.6"
53
-
54
- [package.dependencies]
55
- anyio = ">=3.0.0,<4.0.0"
56
- certifi = "*"
57
- h11 = ">=0.11,<0.13"
58
- sniffio = ">=1.0.0,<2.0.0"
59
-
60
- [package.extras]
61
- http2 = ["h2 (>=3,<5)"]
62
-
63
- [[package]]
64
- name = "httpx"
65
- version = "0.21.1"
66
- description = "The next generation HTTP client."
67
- category = "main"
68
- optional = false
69
- python-versions = ">=3.6"
70
-
71
- [package.dependencies]
72
- certifi = "*"
73
- charset-normalizer = "*"
74
- httpcore = ">=0.14.0,<0.15.0"
75
- rfc3986 = {version = ">=1.3,<2", extras = ["idna2008"]}
76
- sniffio = "*"
77
-
78
- [package.extras]
79
- brotli = ["brotlicffi", "brotli"]
80
- cli = ["click (>=8.0.0,<9.0.0)", "rich (>=10.0.0,<11.0.0)", "pygments (>=2.0.0,<3.0.0)"]
81
- http2 = ["h2 (>=3,<5)"]
82
-
83
- [[package]]
84
- name = "idna"
85
- version = "3.3"
86
- description = "Internationalized Domain Names in Applications (IDNA)"
87
- category = "main"
88
- optional = false
89
- python-versions = ">=3.5"
90
-
91
- [[package]]
92
- name = "rfc3986"
93
- version = "1.5.0"
94
- description = "Validating URI References per RFC 3986"
95
- category = "main"
96
- optional = false
97
- python-versions = "*"
98
-
99
- [package.dependencies]
100
- idna = {version = "*", optional = true, markers = "extra == \"idna2008\""}
101
-
102
- [package.extras]
103
- idna2008 = ["idna"]
104
-
105
- [[package]]
106
- name = "sniffio"
107
- version = "1.2.0"
108
- description = "Sniff out which async library your code is running under"
109
- category = "main"
110
- optional = false
111
- python-versions = ">=3.5"
112
-
113
- [[package]]
114
- name = "typing-extensions"
115
- version = "4.0.1"
116
- description = "Backported and Experimental Type Hints for Python 3.6+"
117
- category = "main"
118
- optional = false
119
- python-versions = ">=3.6"
120
 
121
  [metadata]
122
  lock-version = "1.1"
123
  python-versions = "^3.7"
124
- content-hash = "93d39745f54110cc694b7dad76fdabe028262c62082c0d5452ba51f64ffbebe0"
125
 
126
  [metadata.files]
127
- anyio = [
128
- {file = "anyio-3.4.0-py3-none-any.whl", hash = "sha256:2855a9423524abcdd652d942f8932fda1735210f77a6b392eafd9ff34d3fe020"},
129
- {file = "anyio-3.4.0.tar.gz", hash = "sha256:24adc69309fb5779bc1e06158e143e0b6d2c56b302a3ac3de3083c705a6ed39d"},
130
- ]
131
- certifi = [
132
- {file = "certifi-2021.10.8-py2.py3-none-any.whl", hash = "sha256:d62a0163eb4c2344ac042ab2bdf75399a71a2d8c7d47eac2e2ee91b9d6339569"},
133
- {file = "certifi-2021.10.8.tar.gz", hash = "sha256:78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872"},
134
- ]
135
- charset-normalizer = [
136
- {file = "charset-normalizer-2.0.9.tar.gz", hash = "sha256:b0b883e8e874edfdece9c28f314e3dd5badf067342e42fb162203335ae61aa2c"},
137
- {file = "charset_normalizer-2.0.9-py3-none-any.whl", hash = "sha256:1eecaa09422db5be9e29d7fc65664e6c33bd06f9ced7838578ba40d58bdf3721"},
138
- ]
139
- h11 = [
140
- {file = "h11-0.12.0-py3-none-any.whl", hash = "sha256:36a3cb8c0a032f56e2da7084577878a035d3b61d104230d4bd49c0c6b555a9c6"},
141
- {file = "h11-0.12.0.tar.gz", hash = "sha256:47222cb6067e4a307d535814917cd98fd0a57b6788ce715755fa2b6c28b56042"},
142
- ]
143
- httpcore = [
144
- {file = "httpcore-0.14.3-py3-none-any.whl", hash = "sha256:9a98d2416b78976fc5396ff1f6b26ae9885efbb3105d24eed490f20ab4c95ec1"},
145
- {file = "httpcore-0.14.3.tar.gz", hash = "sha256:d10162a63265a0228d5807964bd964478cbdb5178f9a2eedfebb2faba27eef5d"},
146
- ]
147
- httpx = [
148
- {file = "httpx-0.21.1-py3-none-any.whl", hash = "sha256:208e5ef2ad4d105213463cfd541898ed9d11851b346473539a8425e644bb7c66"},
149
- {file = "httpx-0.21.1.tar.gz", hash = "sha256:02af20df486b78892a614a7ccd4e4e86a5409ec4981ab0e422c579a887acad83"},
150
- ]
151
- idna = [
152
- {file = "idna-3.3-py3-none-any.whl", hash = "sha256:84d9dd047ffa80596e0f246e2eab0b391788b0503584e8945f2368256d2735ff"},
153
- {file = "idna-3.3.tar.gz", hash = "sha256:9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"},
154
- ]
155
- rfc3986 = [
156
- {file = "rfc3986-1.5.0-py2.py3-none-any.whl", hash = "sha256:a86d6e1f5b1dc238b218b012df0aa79409667bb209e58da56d0b94704e712a97"},
157
- {file = "rfc3986-1.5.0.tar.gz", hash = "sha256:270aaf10d87d0d4e095063c65bf3ddbc6ee3d0b226328ce21e036f946e421835"},
158
- ]
159
- sniffio = [
160
- {file = "sniffio-1.2.0-py3-none-any.whl", hash = "sha256:471b71698eac1c2112a40ce2752bb2f4a4814c22a54a3eed3676bc0f5ca9f663"},
161
- {file = "sniffio-1.2.0.tar.gz", hash = "sha256:c4666eecec1d3f50960c6bdf61ab7bc350648da6c126e3cf6898d8cd4ddcd3de"},
162
- ]
163
- typing-extensions = [
164
- {file = "typing_extensions-4.0.1-py3-none-any.whl", hash = "sha256:7f001e5ac290a0c0401508864c7ec868be4e701886d5b573a9528ed3973d9d3b"},
165
- {file = "typing_extensions-4.0.1.tar.gz", hash = "sha256:4ca091dea149f945ec56afb48dae714f21e8692ef22a395223bcd328961b6a0e"},
166
  ]
 
1
  [[package]]
2
+ name = "chardet"
3
+ version = "4.0.0"
4
+ description = "Universal encoding detector for Python 2 and 3"
5
  category = "main"
6
  optional = false
7
+ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
 
9
  [metadata]
10
  lock-version = "1.1"
11
  python-versions = "^3.7"
12
+ content-hash = "89a6c0e408e0e3a2eb61492775c9aba9a2f5a99d39f7d391c9677bc7c981140e"
13
 
14
  [metadata.files]
15
+ chardet = [
16
+ {file = "chardet-4.0.0-py2.py3-none-any.whl", hash = "sha256:f864054d66fd9118f2e67044ac8981a54775ec5b67aed0441892edb553d21da5"},
17
+ {file = "chardet-4.0.0.tar.gz", hash = "sha256:0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"},
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  ]
pyproject.toml CHANGED
@@ -6,7 +6,7 @@ authors = ["freemt <yucongo+fmt@gmail.com>"]
6
 
7
  [tool.poetry.dependencies]
8
  python = "^3.7"
9
- httpx = "^0.21.1"
10
 
11
  [tool.poetry.dev-dependencies]
12
 
 
6
 
7
  [tool.poetry.dependencies]
8
  python = "^3.7"
9
+ chardet = "^4.0.0"
10
 
11
  [tool.poetry.dev-dependencies]
12
 
requirements.txt CHANGED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ chardet
2
+ certifi
3
+ charset-normalizer
4
+ idna
5
+ typing-extensions
run-python-app_py.bat ADDED
@@ -0,0 +1 @@
 
 
1
+ nodemon -w app.py -x python app.py