Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -15,14 +15,14 @@ client = InferenceClient(api_key=api_key)
|
|
15 |
|
16 |
# Function to simulate some process and return the elapsed time
|
17 |
def process_with_timing(): start_time = time.time()
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
|
27 |
# Streamlit app title
|
28 |
st.title("Text-generation model using Streamlit from Inference API (serverless) feature.")
|
|
|
15 |
|
16 |
# Function to simulate some process and return the elapsed time
|
17 |
def process_with_timing(): start_time = time.time()
|
18 |
+
# Simulate a process with sleep
|
19 |
+
time.sleep(2.345)
|
20 |
+
# Change this value to simulate different processing times
|
21 |
+
end_time = time.time()
|
22 |
+
elapsed_time = end_time - start_time
|
23 |
+
minutes, seconds = divmod(elapsed_time, 60)
|
24 |
+
milliseconds = (seconds - int(seconds)) * 1000
|
25 |
+
return minutes, int(seconds), milliseconds
|
26 |
|
27 |
# Streamlit app title
|
28 |
st.title("Text-generation model using Streamlit from Inference API (serverless) feature.")
|