Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,16 +3,18 @@ import pandas as pd
|
|
3 |
import torch
|
4 |
from transformers import pipeline
|
5 |
import datetime
|
6 |
-
from datasets import load_dataset
|
7 |
|
8 |
-
dataset = load_dataset("wikitablequestions", trust_remote_code=True)
|
9 |
-
item = dataset["test"][10] # show first test example
|
10 |
|
11 |
-
def to_pandas(item):
|
12 |
-
return pd.DataFrame(item['table']["rows"], columns=item['table']["header"])
|
13 |
|
14 |
-
df = to_pandas(item)
|
15 |
-
print(df.head())
|
|
|
|
|
16 |
|
17 |
# Function to generate a response using the TAPEX model
|
18 |
def response(user_question, df):
|
|
|
3 |
import torch
|
4 |
from transformers import pipeline
|
5 |
import datetime
|
6 |
+
#from datasets import load_dataset
|
7 |
|
8 |
+
#dataset = load_dataset("wikitablequestions", trust_remote_code=True)
|
9 |
+
#item = dataset["test"][10] # show first test example
|
10 |
|
11 |
+
#def to_pandas(item):
|
12 |
+
#return pd.DataFrame(item['table']["rows"], columns=item['table']["header"])
|
13 |
|
14 |
+
#df = to_pandas(item)
|
15 |
+
#print(df.head())
|
16 |
+
|
17 |
+
df = pd.read_csv("anomalies.csv",quotechar='"',dtype={col: str for col in pd.read_csv('anomalies.csv', nrows=1)})
|
18 |
|
19 |
# Function to generate a response using the TAPEX model
|
20 |
def response(user_question, df):
|