pdarleyjr commited on
Commit
ba359e2
·
1 Parent(s): 6065a8d

Update to use fine-tuned T5 model and fix Gradio launch parameters

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -1,9 +1,10 @@
1
  import gradio as gr
2
  from transformers import T5Tokenizer, T5ForConditionalGeneration
3
 
4
- # Load the base T5 model and tokenizer
5
- model = T5ForConditionalGeneration.from_pretrained('t5-small')
6
- tokenizer = T5Tokenizer.from_pretrained('t5-small')
 
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
  )