Spaces:
Runtime error
Runtime error
Added option for gemma and tinyllama
Browse files
app.py
CHANGED
@@ -5,13 +5,22 @@ import time
|
|
5 |
|
6 |
st.title("Transaction Summarizer")
|
7 |
|
|
|
|
|
|
|
8 |
# Input for submitting new transactions
|
9 |
new_transactions = st.text_area("Enter your transactions (comma-separated)").split(',')
|
10 |
new_transactions = [i.strip() for i in new_transactions if i.strip()]
|
11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
# Submit button for new transactions
|
13 |
if st.button("Submit New Transactions"):
|
14 |
-
url = "
|
15 |
|
16 |
# Retrieve API key from Streamlit secrets
|
17 |
api_key = st.secrets["api_key"]
|
@@ -39,7 +48,7 @@ if st.button("Submit New Transactions"):
|
|
39 |
st.write(f"New Job ID: {job_id}")
|
40 |
|
41 |
# Keep checking status until it's no longer 'IN_QUEUE'
|
42 |
-
status_url = f"
|
43 |
status = "IN_QUEUE"
|
44 |
while status != "COMPLETED":
|
45 |
status_response = requests.get(status_url, headers=headers)
|
|
|
5 |
|
6 |
st.title("Transaction Summarizer")
|
7 |
|
8 |
+
# Input for selecting model
|
9 |
+
model_selection = st.radio("Select model to use:", ["Gemma", "Tinyllama"])
|
10 |
+
|
11 |
# Input for submitting new transactions
|
12 |
new_transactions = st.text_area("Enter your transactions (comma-separated)").split(',')
|
13 |
new_transactions = [i.strip() for i in new_transactions if i.strip()]
|
14 |
|
15 |
+
# Determine URL based on model selection
|
16 |
+
if model_selection == "Gemma":
|
17 |
+
base_url = "https://api.runpod.ai/v2/cdvoxheesm31dc/"
|
18 |
+
elif model_selection == "Tinyllama":
|
19 |
+
base_url = "https://api.runpod.ai/v2/0wnm75vx5o77s1/"
|
20 |
+
|
21 |
# Submit button for new transactions
|
22 |
if st.button("Submit New Transactions"):
|
23 |
+
url = base_url + "run"
|
24 |
|
25 |
# Retrieve API key from Streamlit secrets
|
26 |
api_key = st.secrets["api_key"]
|
|
|
48 |
st.write(f"New Job ID: {job_id}")
|
49 |
|
50 |
# Keep checking status until it's no longer 'IN_QUEUE'
|
51 |
+
status_url = f"{base_url}status/{job_id}"
|
52 |
status = "IN_QUEUE"
|
53 |
while status != "COMPLETED":
|
54 |
status_response = requests.get(status_url, headers=headers)
|