ibrahim313
commited on
Commit
•
6ae9cf7
1
Parent(s):
c209a82
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,13 @@
|
|
1 |
import streamlit as st
|
2 |
from streamlit.components.v1 import html
|
3 |
-
import os
|
4 |
from groq import Groq
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
# Initialize Groq Client
|
7 |
-
client = Groq(api_key=
|
8 |
|
9 |
# Set the title of the app
|
10 |
st.title("AI Chatbot with Groq LLaMA Model")
|
@@ -58,6 +61,7 @@ def get_groq_response(query):
|
|
58 |
return f"An error occurred: {str(e)}"
|
59 |
|
60 |
# Submit button for the chatbot
|
|
|
61 |
if st.button("Submit"):
|
62 |
if user_input:
|
63 |
with st.spinner("Fetching response..."):
|
|
|
1 |
import streamlit as st
|
2 |
from streamlit.components.v1 import html
|
|
|
3 |
from groq import Groq
|
4 |
+
import os
|
5 |
+
|
6 |
+
# Use the Hugging Face secret API key
|
7 |
+
api_key = os.getenv('api_key')
|
8 |
|
9 |
+
# Initialize Groq Client with the Hugging Face secret key
|
10 |
+
client = Groq(api_key=api_key)
|
11 |
|
12 |
# Set the title of the app
|
13 |
st.title("AI Chatbot with Groq LLaMA Model")
|
|
|
61 |
return f"An error occurred: {str(e)}"
|
62 |
|
63 |
# Submit button for the chatbot
|
64 |
+
response = None
|
65 |
if st.button("Submit"):
|
66 |
if user_input:
|
67 |
with st.spinner("Fetching response..."):
|