Spaces:
Running
Running
fschwartzer
commited on
Commit
•
de6d203
1
Parent(s):
b1a6dfa
Update app.py
Browse files
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 |
-
#
|
17 |
-
df['Group'] = df['Group'].str.slice(0, 255)
|
18 |
|
19 |
-
# Function to generate a response using the
|
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 |
|