Bronco92 commited on
Commit
245c501
1 Parent(s): 55f2a3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -1,3 +1,14 @@
1
  import gradio as gr
2
 
3
- gr.Interface.load("models/DATEXIS/CORe-clinical-diagnosis-prediction").launch()
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ def predict(input_text):
4
+ # Limit the input length
5
+ truncated_input = input_text[:512]
6
+
7
+ # Load the interface and make a prediction
8
+ iface = gr.Interface.load("models/DATEXIS/CORe-clinical-diagnosis-prediction")
9
+ prediction = iface.predict([truncated_input])
10
+
11
+ return prediction
12
+
13
+ iface = gr.Interface(fn=predict, inputs='text', outputs='text')
14
+ iface.launch()