AItool commited on
Commit
4aa41d5
·
verified ·
1 Parent(s): f01aaf0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
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(): 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.")
 
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.")