Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,31 +1,3 @@
|
|
1 |
-
|
2 |
-
import gradio as gr
|
3 |
-
import subprocess
|
4 |
-
|
5 |
-
def run_command(command):
|
6 |
-
try:
|
7 |
-
result = subprocess.check_output(command, shell=True, text=True)
|
8 |
-
return result
|
9 |
-
except subprocess.CalledProcessError as e:
|
10 |
-
return f"Error: {e}"
|
11 |
-
|
12 |
-
iface = gr.Interface(
|
13 |
-
fn=run_command,
|
14 |
-
inputs="text",
|
15 |
-
outputs="text",
|
16 |
-
title="Command Output Viewer",
|
17 |
-
description="Enter a command and view its output.",
|
18 |
-
examples=[
|
19 |
-
["ls"],
|
20 |
-
["pwd"],
|
21 |
-
["echo 'Hello, Gradio!'"],
|
22 |
-
["python --version"]
|
23 |
-
]
|
24 |
-
)
|
25 |
-
|
26 |
-
# Updated line with additional port binding for Milvus server
|
27 |
-
iface.launch(server_name="0.0.0.0", server_port=7860, share=True, debug=True)
|
28 |
-
'''
|
29 |
import gradio as gr
|
30 |
|
31 |
from langchain.embeddings import HuggingFaceEmbeddings, HuggingFaceInstructEmbeddings, OpenAIEmbeddings
|
@@ -235,4 +207,31 @@ if __name__ == "__main__":
|
|
235 |
demo.launch(server_name="0.0.0.0",
|
236 |
server_port=7860)
|
237 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
238 |
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
from langchain.embeddings import HuggingFaceEmbeddings, HuggingFaceInstructEmbeddings, OpenAIEmbeddings
|
|
|
207 |
demo.launch(server_name="0.0.0.0",
|
208 |
server_port=7860)
|
209 |
|
210 |
+
'''
|
211 |
+
import gradio as gr
|
212 |
+
import subprocess
|
213 |
+
|
214 |
+
def run_command(command):
|
215 |
+
try:
|
216 |
+
result = subprocess.check_output(command, shell=True, text=True)
|
217 |
+
return result
|
218 |
+
except subprocess.CalledProcessError as e:
|
219 |
+
return f"Error: {e}"
|
220 |
+
|
221 |
+
iface = gr.Interface(
|
222 |
+
fn=run_command,
|
223 |
+
inputs="text",
|
224 |
+
outputs="text",
|
225 |
+
title="Command Output Viewer",
|
226 |
+
description="Enter a command and view its output.",
|
227 |
+
examples=[
|
228 |
+
["ls"],
|
229 |
+
["pwd"],
|
230 |
+
["echo 'Hello, Gradio!'"],
|
231 |
+
["python --version"]
|
232 |
+
]
|
233 |
+
)
|
234 |
+
|
235 |
+
# Updated line with additional port binding for Milvus server
|
236 |
+
iface.launch(server_name="0.0.0.0", server_port=7860, share=True, debug=True)
|
237 |
'''
|