Spaces:
Sleeping
Sleeping
diabling tinyllama as an option
Browse files
app.py
CHANGED
@@ -7,14 +7,30 @@ import time
|
|
7 |
|
8 |
st.title("Transaction Summarizer")
|
9 |
|
10 |
-
#
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
# Determine URL based on model selection
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
|
|
18 |
|
19 |
# Initialize session state for jobs list
|
20 |
if "jobs" not in st.session_state:
|
@@ -23,6 +39,7 @@ if "jobs" not in st.session_state:
|
|
23 |
|
24 |
# Define the transaction processing function
|
25 |
def process_transactions(transactions):
|
|
|
26 |
url = base_url + "runsync"
|
27 |
|
28 |
# Retrieve API key from Streamlit secrets
|
|
|
7 |
|
8 |
st.title("Transaction Summarizer")
|
9 |
|
10 |
+
# custom CSS to gray out Tinyllama
|
11 |
+
st.markdown("""
|
12 |
+
<style>
|
13 |
+
.disabled-option {
|
14 |
+
color: gray;
|
15 |
+
pointer-events: none;
|
16 |
+
cursor: not-allowed;
|
17 |
+
}
|
18 |
+
</style>
|
19 |
+
""", unsafe_allow_html=True)
|
20 |
+
|
21 |
+
# model selection with grayed-out option
|
22 |
+
model_selection = st.radio(
|
23 |
+
"Select model to use:",
|
24 |
+
["Gemma", "Tinyllama (disabled)"],
|
25 |
+
index=0
|
26 |
+
)
|
27 |
|
28 |
# Determine URL based on model selection
|
29 |
+
def get_base_url():
|
30 |
+
if model_selection == "Gemma":
|
31 |
+
return "https://api.runpod.ai/v2/lld3iiy6fx7hcf/"
|
32 |
+
elif model_selection == "Tinyllama":
|
33 |
+
return "https://api.runpod.ai/v2/0wnm75vx5o77s1/"
|
34 |
|
35 |
# Initialize session state for jobs list
|
36 |
if "jobs" not in st.session_state:
|
|
|
39 |
|
40 |
# Define the transaction processing function
|
41 |
def process_transactions(transactions):
|
42 |
+
base_url = get_base_url()
|
43 |
url = base_url + "runsync"
|
44 |
|
45 |
# Retrieve API key from Streamlit secrets
|