Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
from datasets import load_dataset
|
|
|
4 |
import matplotlib.pyplot as plt
|
5 |
import seaborn as sns
|
6 |
|
7 |
dataset = load_dataset('dar-tau/grammar-attention-maps-opt-350m')['train']
|
|
|
8 |
|
9 |
def analyze_sentence(index):
|
10 |
row = dataset[index]
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
from datasets import load_dataset
|
4 |
+
from transformers import AutoTokenizer
|
5 |
import matplotlib.pyplot as plt
|
6 |
import seaborn as sns
|
7 |
|
8 |
dataset = load_dataset('dar-tau/grammar-attention-maps-opt-350m')['train']
|
9 |
+
tokenizer = AutoTokenizer.from_pretrained('facebook/opt-350m', add_prefix_space=True)
|
10 |
|
11 |
def analyze_sentence(index):
|
12 |
row = dataset[index]
|