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