kwabs22
commited on
Commit
•
03936f4
1
Parent(s):
cb5934e
Blocks needs queue
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ def generate_response(user_message): #Figure Out the parameters later and find a
|
|
13 |
]
|
14 |
|
15 |
# Start the subprocess
|
16 |
-
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
|
17 |
|
18 |
start_time = time.time()
|
19 |
alllines = ""
|
@@ -22,6 +22,7 @@ def generate_response(user_message): #Figure Out the parameters later and find a
|
|
22 |
for line in process.stdout:
|
23 |
alllines += " " + line
|
24 |
elapsed_time = time.time() - start_time # Calculate elapsed time
|
|
|
25 |
yield f"{alllines} \n\n [Inference time: {elapsed_time:.2f} seconds]"
|
26 |
|
27 |
# Wait for the subprocess to finish if it hasn't already
|
|
|
13 |
]
|
14 |
|
15 |
# Start the subprocess
|
16 |
+
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, bufsize=1)
|
17 |
|
18 |
start_time = time.time()
|
19 |
alllines = ""
|
|
|
22 |
for line in process.stdout:
|
23 |
alllines += " " + line
|
24 |
elapsed_time = time.time() - start_time # Calculate elapsed time
|
25 |
+
print(line)
|
26 |
yield f"{alllines} \n\n [Inference time: {elapsed_time:.2f} seconds]"
|
27 |
|
28 |
# Wait for the subprocess to finish if it hasn't already
|