cta2106 commited on
Commit
c09ea67
·
1 Parent(s): 094951f

fixed type hinting

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,10 +1,10 @@
1
- from typing import Any
2
 
3
  from transformers import pipeline, LongformerForSequenceClassification, LongformerTokenizer, Trainer
4
  import gradio as gr
5
 
6
 
7
- def predict_fn(text: str) -> tuple[Any, Any]:
8
  model = LongformerForSequenceClassification.from_pretrained("model")
9
  tokenizer = LongformerTokenizer.from_pretrained("allenai/longformer-base-4096")
10
  p = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)
 
1
+ from typing import Any, Tuple
2
 
3
  from transformers import pipeline, LongformerForSequenceClassification, LongformerTokenizer, Trainer
4
  import gradio as gr
5
 
6
 
7
+ def predict_fn(text: str) -> Tuple[Any, Any]:
8
  model = LongformerForSequenceClassification.from_pretrained("model")
9
  tokenizer = LongformerTokenizer.from_pretrained("allenai/longformer-base-4096")
10
  p = pipeline("sentiment-analysis", model=model, tokenizer=tokenizer)