fschwartzer commited on
Commit
e2a88a0
·
verified ·
1 Parent(s): ef37c27

Update app[tapex].py

Browse files
Files changed (1) hide show
  1. app[tapex].py +13 -5
app[tapex].py CHANGED
@@ -4,11 +4,19 @@ import torch
4
  from transformers import TapexTokenizer, BartForConditionalGeneration
5
  import datetime
6
 
7
- # Load the data
8
- df = pd.read_excel('discrepantes.xlsx')
9
- df.fillna(0, inplace=True)
10
- table_data = df.astype(str)
11
- print(table_data.head())
 
 
 
 
 
 
 
 
12
 
13
  # Function to generate a response using the TAPEX model
14
  def response(user_question, table_data):
 
4
  from transformers import TapexTokenizer, BartForConditionalGeneration
5
  import datetime
6
 
7
+ # Load the CSV file
8
+ df = pd.read_csv("anomalies.csv", quotechar='"')
9
+
10
+ # Filter 'real' higher than 10 Million
11
+ df= df[df['real'] >= 1000000.]
12
+
13
+ # Convert 'real' column to standard float format and then to strings
14
+ df['real'] = df['real'].apply(lambda x: f"{x:.2f}")
15
+
16
+ # Fill NaN values and convert all columns to strings
17
+ df = df.fillna('').astype(str)
18
+
19
+ table_data = df
20
 
21
  # Function to generate a response using the TAPEX model
22
  def response(user_question, table_data):