Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,16 +13,12 @@ load_dotenv()
|
|
| 13 |
MAX_TOKENS = 4000
|
| 14 |
DEFAULT_TEMPERATURE = 0.5
|
| 15 |
|
| 16 |
-
#
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
return InferenceClient(
|
| 23 |
-
base_url="https://api-inference.huggingface.co/v1",
|
| 24 |
-
api_key=api_key
|
| 25 |
-
)
|
| 26 |
|
| 27 |
# Create supported models
|
| 28 |
model_links = {
|
|
@@ -49,8 +45,6 @@ st.sidebar.button('Reset Chat', on_click=reset_conversation) #Reset button
|
|
| 49 |
def main():
|
| 50 |
st.header('Multi-Models')
|
| 51 |
|
| 52 |
-
# Initialize client
|
| 53 |
-
client = initialize_client()
|
| 54 |
|
| 55 |
# Sidebar for model selection and temperature
|
| 56 |
selected_model = st.sidebar.selectbox("Select Model", list(model_links.keys()))
|
|
|
|
| 13 |
MAX_TOKENS = 4000
|
| 14 |
DEFAULT_TEMPERATURE = 0.5
|
| 15 |
|
| 16 |
+
# initialize the client
|
| 17 |
+
client = OpenAI(
|
| 18 |
+
base_url="https://api-inference.huggingface.co/v1",
|
| 19 |
+
api_key=os.environ.get('API_KEY') # Replace with your token
|
| 20 |
+
)
|
| 21 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
# Create supported models
|
| 24 |
model_links = {
|
|
|
|
| 45 |
def main():
|
| 46 |
st.header('Multi-Models')
|
| 47 |
|
|
|
|
|
|
|
| 48 |
|
| 49 |
# Sidebar for model selection and temperature
|
| 50 |
selected_model = st.sidebar.selectbox("Select Model", list(model_links.keys()))
|