Update to use fine-tuned T5 model and fix Gradio launch parameters
Browse files
app.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
3 |
|
4 |
-
# Load the
|
5 |
-
|
6 |
-
|
|
|
7 |
|
8 |
def generate_clinical_report(input_text):
|
9 |
"""
|
@@ -59,7 +60,7 @@ if __name__ == "__main__":
|
|
59 |
show_api=True,
|
60 |
allowed_paths=None, # Allow all paths
|
61 |
quiet=True, # Reduce logging noise
|
62 |
-
enable_queue=True,
|
63 |
api_open=True, # Explicitly enable API access
|
64 |
-
cors_allowed_origins="*" # Allow cross-origin requests
|
|
|
65 |
)
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import T5Tokenizer, T5ForConditionalGeneration
|
3 |
|
4 |
+
# Load the fine-tuned T5 model and tokenizer
|
5 |
+
model_path = "C:/Users/admin/Desktop/my_fine_tuned_t5_small"
|
6 |
+
model = T5ForConditionalGeneration.from_pretrained(model_path)
|
7 |
+
tokenizer = T5Tokenizer.from_pretrained(model_path)
|
8 |
|
9 |
def generate_clinical_report(input_text):
|
10 |
"""
|
|
|
60 |
show_api=True,
|
61 |
allowed_paths=None, # Allow all paths
|
62 |
quiet=True, # Reduce logging noise
|
|
|
63 |
api_open=True, # Explicitly enable API access
|
64 |
+
cors_allowed_origins="*", # Allow cross-origin requests
|
65 |
+
concurrency_count=1 # Enable queuing with concurrency
|
66 |
)
|