vikvenk commited on
Commit
3812f64
1 Parent(s): 8a708e6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -10,17 +10,18 @@ from transformers import RobertaTokenizer, RobertaModel
10
  from transformers import AutoModelForSequenceClassification
11
  from transformers import TFAutoModelForSequenceClassification
12
  from transformers import AutoTokenizer, AutoModelForTokenClassification
13
- from transformers import XLNetTokenizer, XLNetForSequenceClassification
14
  import matplotlib.pyplot as plt
15
  import sys
16
  import csv
17
- import sentencepiece
18
  csv.field_size_limit(sys.maxsize)
19
 
20
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
21
 
22
- tokenizer = AutoTokenizer.from_pretrained("vikvenk/ADR_Detection")
23
- model = AutoModelForSequenceClassification.from_pretrained("vikvenk/ADR_Detection").to(device)
 
24
  # build a pipeline object to do predictions
25
  pred = transformers.pipeline("text-classification", model=model,
26
  tokenizer=tokenizer, return_all_scores=True)
@@ -137,4 +138,4 @@ with gr.Blocks(title=title) as demo:
137
  # , med, sym
138
  ], main, cache_examples=True)
139
 
140
- demo.launch()
 
10
  from transformers import AutoModelForSequenceClassification
11
  from transformers import TFAutoModelForSequenceClassification
12
  from transformers import AutoTokenizer, AutoModelForTokenClassification
13
+
14
  import matplotlib.pyplot as plt
15
  import sys
16
  import csv
17
+
18
  csv.field_size_limit(sys.maxsize)
19
 
20
  device = "cuda:0" if torch.cuda.is_available() else "cpu"
21
 
22
+ tokenizer = AutoTokenizer.from_pretrained("MarkAdamsMSBA24/ADRv2024")
23
+ model = AutoModelForSequenceClassification.from_pretrained("MarkAdamsMSBA24/ADRv2024").to(device)
24
+
25
  # build a pipeline object to do predictions
26
  pred = transformers.pipeline("text-classification", model=model,
27
  tokenizer=tokenizer, return_all_scores=True)
 
138
  # , med, sym
139
  ], main, cache_examples=True)
140
 
141
+ demo.launch()