Spaces:
Sleeping
Sleeping
arjunascagnetto
commited on
Commit
•
526d2c9
1
Parent(s):
737d406
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,17 @@
|
|
1 |
|
2 |
|
3 |
import gradio as gr
|
4 |
-
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
5 |
-
from transformers import BertTokenizer, BertLMHeadModel
|
6 |
|
7 |
# Load pre-trained model and tokenizer
|
8 |
-
tokenizer = BertTokenizer.from_pretrained('clinicalBERT')
|
9 |
-
model = BertLMHeadModel.from_pretrained('clinicalBERT')
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
# Define a function to generate text using the model
|
12 |
def generate_text(input_text):
|
|
|
1 |
|
2 |
|
3 |
import gradio as gr
|
4 |
+
#from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
5 |
+
#from transformers import BertTokenizer, BertLMHeadModel
|
6 |
|
7 |
# Load pre-trained model and tokenizer
|
8 |
+
#tokenizer = BertTokenizer.from_pretrained('clinicalBERT')
|
9 |
+
#model = BertLMHeadModel.from_pretrained('clinicalBERT')
|
10 |
+
|
11 |
+
from transformers import AutoTokenizer, AutoModel
|
12 |
+
tokenizer = AutoTokenizer.from_pretrained("medicalai/ClinicalBERT")
|
13 |
+
model = AutoModel.from_pretrained("medicalai/ClinicalBERT")
|
14 |
+
|
15 |
|
16 |
# Define a function to generate text using the model
|
17 |
def generate_text(input_text):
|