Illia56 commited on
Commit
019cdf0
1 Parent(s): 6e9959e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -13,15 +13,19 @@ client = Client("https://ysharma-explore-llamav2-with-tgi.hf.space/")
13
 
14
  # Prediction function
15
  def predict(message, system_prompt="", temperature=0.9, max_new_tokens=4096):
16
- return client.predict(
17
- message, # str in 'Message' Textbox component
18
- system_prompt, # str in 'Optional system prompt' Textbox component
19
- temperature, # int | float (numeric value between 0.0 and 1.0)
20
- max_new_tokens, # int | float (numeric value between 0 and 4096)
21
- 0.3, # int | float (numeric value between 0.0 and 1)
22
- 1, # int | float (numeric value between 1.0 and 2.0)
23
- api_name="/chat"
24
- )
 
 
 
 
25
 
26
  # Streamlit UI
27
  st.title(TITLE)
 
13
 
14
  # Prediction function
15
  def predict(message, system_prompt="", temperature=0.9, max_new_tokens=4096):
16
+ with st.status("Requesting LLama-2"):
17
+ st.write("Requesting API")
18
+ response = client.predict(
19
+ message, # str in 'Message' Textbox component
20
+ system_prompt, # str in 'Optional system prompt' Textbox component
21
+ temperature, # int | float (numeric value between 0.0 and 1.0)
22
+ max_new_tokens, # int | float (numeric value between 0 and 4096)
23
+ 0.3, # int | float (numeric value between 0.0 and 1)
24
+ 1, # int | float (numeric value between 1.0 and 2.0)
25
+ api_name="/chat"
26
+ )
27
+ st.write("Done")
28
+ return response
29
 
30
  # Streamlit UI
31
  st.title(TITLE)