Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -22,7 +22,14 @@ if st.button("Generate Text"):
|
|
22 |
if user_input:
|
23 |
with st.spinner(f"Generating text using {model_id}..."):
|
24 |
# Perform inference using the selected model
|
25 |
-
response = client.text_generation(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
st.success("Text generated!")
|
27 |
st.write(response)
|
28 |
else:
|
|
|
22 |
if user_input:
|
23 |
with st.spinner(f"Generating text using {model_id}..."):
|
24 |
# Perform inference using the selected model
|
25 |
+
response = client.text_generation(model=
|
26 |
+
messages=[
|
27 |
+
{"role": "system", "content": "You are a question answering assistant."},
|
28 |
+
{"role": "user", "content": prompt1}
|
29 |
+
],
|
30 |
+
max_tokens=500,
|
31 |
+
stream=False,
|
32 |
+
))
|
33 |
st.success("Text generated!")
|
34 |
st.write(response)
|
35 |
else:
|