Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,8 +12,7 @@ def query(payload):
|
|
| 12 |
response = requests.post(API_URL, headers=headers, json=payload)
|
| 13 |
return response.json()
|
| 14 |
|
| 15 |
-
|
| 16 |
-
st.title("Chat App with Hugging Face")
|
| 17 |
|
| 18 |
# Input textbox
|
| 19 |
user_input = st.text_input("You:", "")
|
|
@@ -30,33 +29,13 @@ if st.button("Send"):
|
|
| 30 |
else:
|
| 31 |
st.error("No response from the model")
|
| 32 |
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
User: <utterance>
|
| 37 |
-
Assistant: <utterance>
|
| 38 |
-
User: <utterance>
|
| 39 |
-
Assistant: <utterance>
|
| 40 |
-
...
|
| 41 |
-
In this app, you can explore the outputs of multiple LLMs when prompted in this way.
|
| 42 |
-
""")
|
| 43 |
-
|
| 44 |
-
# CSS styles
|
| 45 |
-
st.markdown(
|
| 46 |
-
"""
|
| 47 |
-
<style>
|
| 48 |
-
#col_container {margin-left: auto; margin-right: auto;}
|
| 49 |
-
#chatbot {height: 520px; overflow: auto;}
|
| 50 |
-
</style>
|
| 51 |
-
""",
|
| 52 |
-
unsafe_allow_html=True
|
| 53 |
-
)
|
| 54 |
|
| 55 |
# Title and description
|
| 56 |
st.title("Large Language Model Chat API")
|
| 57 |
-
|
| 58 |
-
<div align="center">Powered by: <a href=https://github.com/huggingface/text-generation-inference>Text Generation Inference</a></div>
|
| 59 |
-
""")
|
| 60 |
|
| 61 |
# Model selection
|
| 62 |
model = st.radio(
|
|
@@ -73,7 +52,7 @@ model = st.radio(
|
|
| 73 |
)
|
| 74 |
|
| 75 |
# Input textbox
|
| 76 |
-
input_text = st.text_input(label="Type an input and press Enter", placeholder="
|
| 77 |
|
| 78 |
# Parameters
|
| 79 |
with st.expander("Parameters", expanded=False):
|
|
|
|
| 12 |
response = requests.post(API_URL, headers=headers, json=payload)
|
| 13 |
return response.json()
|
| 14 |
|
| 15 |
+
|
|
|
|
| 16 |
|
| 17 |
# Input textbox
|
| 18 |
user_input = st.text_input("You:", "")
|
|
|
|
| 29 |
else:
|
| 30 |
st.error("No response from the model")
|
| 31 |
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
# Title and description
|
| 37 |
st.title("Large Language Model Chat API")
|
| 38 |
+
|
|
|
|
|
|
|
| 39 |
|
| 40 |
# Model selection
|
| 41 |
model = st.radio(
|
|
|
|
| 52 |
)
|
| 53 |
|
| 54 |
# Input textbox
|
| 55 |
+
input_text = st.text_input(label="Type an input and press Enter", placeholder="What is Deep Learning?")
|
| 56 |
|
| 57 |
# Parameters
|
| 58 |
with st.expander("Parameters", expanded=False):
|