Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -3,10 +3,15 @@ import pandas as pd
|
|
3 |
import torch
|
4 |
from transformers import pipeline
|
5 |
import datetime
|
|
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
10 |
|
11 |
# Function to generate a response using the TAPEX model
|
12 |
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")
|
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 |
|
16 |
# Function to generate a response using the TAPEX model
|
17 |
def response(user_question, df):
|