Spaces:
No application file
No application file
Update streamlit_app.py
Browse files- streamlit_app.py +5 -5
streamlit_app.py
CHANGED
|
@@ -5,10 +5,10 @@ import docx2txt
|
|
| 5 |
import PyPDF2
|
| 6 |
|
| 7 |
# ------------------------------
|
| 8 |
-
#
|
| 9 |
# ------------------------------
|
| 10 |
-
|
| 11 |
-
client = Groq(api_key=
|
| 12 |
|
| 13 |
# ------------------------------
|
| 14 |
# Streamlit page config and theme
|
|
@@ -90,7 +90,7 @@ Requirement:
|
|
| 90 |
"""
|
| 91 |
response = client.chat.completions.create(
|
| 92 |
model="llama-3.1-8b-instant",
|
| 93 |
-
messages=[{"role":"user", "content": prompt}],
|
| 94 |
max_tokens=1500
|
| 95 |
)
|
| 96 |
return response.choices[0].message.content
|
|
@@ -125,7 +125,7 @@ if generate_btn:
|
|
| 125 |
|
| 126 |
st.subheader("🔸 Generated Test Cases")
|
| 127 |
with st.expander("View Test Cases", expanded=True):
|
| 128 |
-
st.
|
| 129 |
|
| 130 |
st.download_button(
|
| 131 |
"Download Test Cases as TXT",
|
|
|
|
| 5 |
import PyPDF2
|
| 6 |
|
| 7 |
# ------------------------------
|
| 8 |
+
# Get API key from Hugging Face Secrets
|
| 9 |
# ------------------------------
|
| 10 |
+
GROQ_API_KEY = os.getenv("GROQ_API_KEY")
|
| 11 |
+
client = Groq(api_key=GROQ_API_KEY)
|
| 12 |
|
| 13 |
# ------------------------------
|
| 14 |
# Streamlit page config and theme
|
|
|
|
| 90 |
"""
|
| 91 |
response = client.chat.completions.create(
|
| 92 |
model="llama-3.1-8b-instant",
|
| 93 |
+
messages=[{"role": "user", "content": prompt}],
|
| 94 |
max_tokens=1500
|
| 95 |
)
|
| 96 |
return response.choices[0].message.content
|
|
|
|
| 125 |
|
| 126 |
st.subheader("🔸 Generated Test Cases")
|
| 127 |
with st.expander("View Test Cases", expanded=True):
|
| 128 |
+
st.code(testcases_output, language="text")
|
| 129 |
|
| 130 |
st.download_button(
|
| 131 |
"Download Test Cases as TXT",
|