Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import streamlit as st
|
|
| 2 |
from streamlit_chat import message
|
| 3 |
import requests
|
| 4 |
|
| 5 |
-
url = 'https://api.webraft.in/
|
| 6 |
st.set_page_config(page_title="WebraftAI Chat", page_icon=":robot_face:")
|
| 7 |
st.markdown("<h1 style='text-align: center;'>WebraftAI Chat</h1>", unsafe_allow_html=True)
|
| 8 |
|
|
@@ -23,8 +23,8 @@ if 'api_key' not in st.session_state:
|
|
| 23 |
st.session_state['api_key']=""
|
| 24 |
|
| 25 |
st.sidebar.title("Settings")
|
| 26 |
-
model_name = st.sidebar.selectbox("Chat Model:", ("gpt-3.5-turbo","gpt-3.5-turbo-
|
| 27 |
-
image_model = st.sidebar.selectbox("Image Model:", ("dalle-3","
|
| 28 |
counter_placeholder = st.sidebar.empty()
|
| 29 |
|
| 30 |
api_key = st.sidebar.text_input("API_Key", value=st.session_state['api_key'], max_chars=None,placeholder=st.session_state['api_key'], key=None, type="password", label_visibility="visible")
|
|
@@ -42,16 +42,7 @@ if 'messages' not in st.session_state:
|
|
| 42 |
st.session_state['messages'] = [
|
| 43 |
{"role": "system", "content": system_message}
|
| 44 |
]
|
| 45 |
-
|
| 46 |
-
model = "gpt-3.5-turbo"
|
| 47 |
-
elif model_name == "gpt-3.5-turbo-16k":
|
| 48 |
-
model = "gpt-3.5-turbo-16k"
|
| 49 |
-
elif model_name == "gpt-4-32k":
|
| 50 |
-
model = "gpt-4-32k"
|
| 51 |
-
elif model_name == "mini-orca-v3-13b":
|
| 52 |
-
model = "orca-mini-v3-13b"
|
| 53 |
-
else:
|
| 54 |
-
model = model_name
|
| 55 |
|
| 56 |
if clear_button:
|
| 57 |
st.session_state['generated'] = []
|
|
|
|
| 2 |
from streamlit_chat import message
|
| 3 |
import requests
|
| 4 |
|
| 5 |
+
url = 'https://api.webraft.in/v2/chat/completions'
|
| 6 |
st.set_page_config(page_title="WebraftAI Chat", page_icon=":robot_face:")
|
| 7 |
st.markdown("<h1 style='text-align: center;'>WebraftAI Chat</h1>", unsafe_allow_html=True)
|
| 8 |
|
|
|
|
| 23 |
st.session_state['api_key']=""
|
| 24 |
|
| 25 |
st.sidebar.title("Settings")
|
| 26 |
+
model_name = st.sidebar.selectbox("Chat Model:", ("gpt-3.5-turbo","gpt-3.5-turbo-1106","gpt-4","gpt-4-32k","gpt-4-1106-preview","gpt-4-0125-preview","gpt-4o","claude-3-haiku","claude-3-sonnet","claude-3-opus",""))
|
| 27 |
+
image_model = st.sidebar.selectbox("Image Model:", ("dalle-3","sdxl", "midjourney","stable-cascade"))
|
| 28 |
counter_placeholder = st.sidebar.empty()
|
| 29 |
|
| 30 |
api_key = st.sidebar.text_input("API_Key", value=st.session_state['api_key'], max_chars=None,placeholder=st.session_state['api_key'], key=None, type="password", label_visibility="visible")
|
|
|
|
| 42 |
st.session_state['messages'] = [
|
| 43 |
{"role": "system", "content": system_message}
|
| 44 |
]
|
| 45 |
+
model = model_name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
|
| 47 |
if clear_button:
|
| 48 |
st.session_state['generated'] = []
|