Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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()
|