jarif commited on
Commit
b0ac9b3
·
verified ·
1 Parent(s): fe69a93

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,14 +1,16 @@
1
  import torch
2
-
3
  from fastai.text.all import *
4
- from blurr.text.data.all import *
5
- from blurr.text.modeling.all import *
6
- from transformers import BartForConditionalGeneration
7
 
8
  # Load the pre-trained model and tokenizer (adjust for Bart if needed)
9
  pretrained_model_name = "facebook/bart-large-cnn" # Or "facebook/bart-base"
10
  hf_tokenizer = BartTokenizer.from_pretrained(pretrained_model_name)
11
 
 
 
 
12
  def summarize(article):
13
  # Define your data transformation pipeline here, if applicable
14
  # ...
 
1
  import torch
2
+ import gradio as gr
3
  from fastai.text.all import *
4
+ from transformers import BartTokenizer
5
+ from datasets import load_metric
 
6
 
7
  # Load the pre-trained model and tokenizer (adjust for Bart if needed)
8
  pretrained_model_name = "facebook/bart-large-cnn" # Or "facebook/bart-base"
9
  hf_tokenizer = BartTokenizer.from_pretrained(pretrained_model_name)
10
 
11
+ # Load the SQuAD metric
12
+ squad_metric = load_metric("squad")
13
+
14
  def summarize(article):
15
  # Define your data transformation pipeline here, if applicable
16
  # ...