fschwartzer commited on
Commit
de6d203
1 Parent(s): b1a6dfa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -7,16 +7,16 @@ import datetime
7
  # Load the CSV file and ensure proper formatting
8
  df = pd.read_csv("anomalies.csv", quotechar='"')
9
 
10
- # Convert 'real' column to standard float format
11
  df['real'] = df['real'].apply(lambda x: f"{x:.2f}")
12
 
13
  # Fill NaN values and convert all columns to strings
14
  df = df.fillna('').astype(str)
15
 
16
- # Ensure that the 'Group' column doesn't have excessive length or unexpected values
17
- df['Group'] = df['Group'].str.slice(0, 255) # Truncate to 255 characters if needed
18
 
19
- # Function to generate a response using the TAPEX model
20
  def response(user_question, df):
21
  a = datetime.datetime.now()
22
 
 
7
  # Load the CSV file and ensure proper formatting
8
  df = pd.read_csv("anomalies.csv", quotechar='"')
9
 
10
+ # Convert 'real' column to standard float format and then to strings
11
  df['real'] = df['real'].apply(lambda x: f"{x:.2f}")
12
 
13
  # Fill NaN values and convert all columns to strings
14
  df = df.fillna('').astype(str)
15
 
16
+ # Truncate long strings in 'Group' column if necessary
17
+ df['Group'] = df['Group'].str.slice(0, 255)
18
 
19
+ # Function to generate a response using the TAPAS model
20
  def response(user_question, df):
21
  a = datetime.datetime.now()
22