Spaces:
Running
on
Zero
Running
on
Zero
Update ssh
Browse files- serve/upload.py +7 -10
serve/upload.py
CHANGED
@@ -26,17 +26,14 @@ def get_image_from_url(image_url):
|
|
26 |
|
27 |
def get_random_mscoco_prompt():
|
28 |
global sftp_client
|
29 |
-
|
30 |
-
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
content = f.read().decode('utf-8')
|
38 |
-
print(f"Content of {file}:")
|
39 |
-
print("\n")
|
40 |
return content
|
41 |
|
42 |
|
|
|
26 |
|
27 |
def get_random_mscoco_prompt():
|
28 |
global sftp_client
|
29 |
+
num = random.randint(0, 2999)
|
30 |
+
file = "{}.txt".format(num)
|
31 |
|
32 |
+
remote_file_path = os.path.join(SSH_MSCOCO, file)
|
33 |
+
with sftp_client.file(remote_file_path, 'r') as f:
|
34 |
+
content = f.read().decode('utf-8')
|
35 |
+
print(f"Content of {file}:")
|
36 |
+
print("\n")
|
|
|
|
|
|
|
37 |
return content
|
38 |
|
39 |
|