Upload folder using huggingface_hub
Browse files- vm_data_server.py +6 -1
vm_data_server.py
CHANGED
|
@@ -280,13 +280,18 @@ def execute_command():
|
|
| 280 |
|
| 281 |
# Execute command with timeout
|
| 282 |
import subprocess
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 283 |
result = subprocess.run(
|
| 284 |
command,
|
| 285 |
shell=True,
|
| 286 |
capture_output=True,
|
| 287 |
text=True,
|
| 288 |
timeout=30, # 30 second timeout
|
| 289 |
-
cwd=
|
| 290 |
)
|
| 291 |
|
| 292 |
return jsonify({
|
|
|
|
| 280 |
|
| 281 |
# Execute command with timeout
|
| 282 |
import subprocess
|
| 283 |
+
import os
|
| 284 |
+
|
| 285 |
+
# Use current working directory (where the server was started)
|
| 286 |
+
cwd = os.getcwd()
|
| 287 |
+
|
| 288 |
result = subprocess.run(
|
| 289 |
command,
|
| 290 |
shell=True,
|
| 291 |
capture_output=True,
|
| 292 |
text=True,
|
| 293 |
timeout=30, # 30 second timeout
|
| 294 |
+
cwd=cwd # Run in current directory
|
| 295 |
)
|
| 296 |
|
| 297 |
return jsonify({
|