Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 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)
|