Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,4 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
-
def test_function(input_text):
|
4 |
-
return f"You said: {input_text}"
|
5 |
-
|
6 |
-
interface = gr.Interface(fn=test_function, inputs="text", outputs="text")
|
7 |
-
interface.launch()
|
8 |
from transformers import AutoModelForMaskedLM, AutoTokenizer, pipeline
|
9 |
|
10 |
# Load ClinicalBERT model
|
@@ -12,9 +6,6 @@ model_name = "emilyalsentzer/Bio_ClinicalBERT"
|
|
12 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
13 |
model = AutoModelForMaskedLM.from_pretrained(model_name)
|
14 |
|
15 |
-
# Create a fill-mask pipeline
|
16 |
-
nlp_pipeline = pipeline("fill-mask", model=model, tokenizer=tokenizer)
|
17 |
-
|
18 |
# Create a text generation pipeline
|
19 |
nlp_pipeline = pipeline("fill-mask", model=model, tokenizer=tokenizer)
|
20 |
|
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
from transformers import AutoModelForMaskedLM, AutoTokenizer, pipeline
|
3 |
|
4 |
# Load ClinicalBERT model
|
|
|
6 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
7 |
model = AutoModelForMaskedLM.from_pretrained(model_name)
|
8 |
|
|
|
|
|
|
|
9 |
# Create a text generation pipeline
|
10 |
nlp_pipeline = pipeline("fill-mask", model=model, tokenizer=tokenizer)
|
11 |
|