ozzyable commited on
Commit
b1ce02e
·
1 Parent(s): b80550c

fix a minor mistake

Browse files
Files changed (1) hide show
  1. app.py +2 -16
app.py CHANGED
@@ -6,11 +6,11 @@ import time
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_input = st.text_area("Enter your transactions (comma-separated)", key="input_area")
13
- submit_button = st.button("Submit New Transactions", key="submit_button")
14
 
15
  if submit_button:
16
  # Split transactions and strip whitespace
@@ -24,8 +24,6 @@ if model_selection == "Gemma":
24
  elif model_selection == "Tinyllama":
25
  base_url = "https://api.runpod.ai/v2/0wnm75vx5o77s1/"
26
 
27
- # Processing flag
28
- processing = False
29
 
30
  # When submit button is clicked and there are transactions to process
31
  if submit_button and new_transactions:
@@ -49,7 +47,6 @@ if submit_button and new_transactions:
49
  # Show a spinner while waiting for the response
50
  with st.spinner("Processing..."):
51
  try:
52
- processing = True
53
 
54
  # Send POST request to start processing
55
  response = requests.post(url, headers=headers, data=json_data)
@@ -75,18 +72,7 @@ if submit_button and new_transactions:
75
  except requests.exceptions.RequestException as e:
76
  st.error(f"An error occurred: {e}")
77
  finally:
78
- processing = False
79
  st.spinner(False) # Turn off the spinner after response is received
80
 
81
- # Disable input elements while processing
82
- if processing:
83
- st.text_area("Enter your transactions (comma-separated)", value=new_transactions_input, key="disabled_area", disabled=True)
84
- st.radio("Select model to use:", ["Gemma", "Tinyllama"], index=0, key="disabled_radio", disabled=True)
85
- st.button("Submit New Transactions", disabled=True, key="disabled_button")
86
- else:
87
- st.text_area("Enter your transactions (comma-separated)", value=new_transactions_input, key="enabled_area")
88
- st.radio("Select model to use:", ["Gemma", "Tinyllama"], index=0, key="enabled_radio")
89
- st.button("Submit New Transactions", key="enabled_button")
90
-
91
  if st.button("Reset", key="reset_button"):
92
  st.text_area("Enter your transactions (comma-separated)", value="", key="reset_area")
 
6
  st.title("Transaction Summarizer")
7
 
8
  # Input for selecting model
9
+ model_selection = st.radio("Select model to use:", ["Tinyllama", "Gemma"])
10
 
11
  # Input for submitting new transactions
12
  new_transactions_input = st.text_area("Enter your transactions (comma-separated)", key="input_area")
13
+ submit_button = st.button("Submit New Transactions", type="primary")
14
 
15
  if submit_button:
16
  # Split transactions and strip whitespace
 
24
  elif model_selection == "Tinyllama":
25
  base_url = "https://api.runpod.ai/v2/0wnm75vx5o77s1/"
26
 
 
 
27
 
28
  # When submit button is clicked and there are transactions to process
29
  if submit_button and new_transactions:
 
47
  # Show a spinner while waiting for the response
48
  with st.spinner("Processing..."):
49
  try:
 
50
 
51
  # Send POST request to start processing
52
  response = requests.post(url, headers=headers, data=json_data)
 
72
  except requests.exceptions.RequestException as e:
73
  st.error(f"An error occurred: {e}")
74
  finally:
 
75
  st.spinner(False) # Turn off the spinner after response is received
76
 
 
 
 
 
 
 
 
 
 
 
77
  if st.button("Reset", key="reset_button"):
78
  st.text_area("Enter your transactions (comma-separated)", value="", key="reset_area")