File size: 730 Bytes
a91b18c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import gradio as gr

def predict(meals, hours_left, distance):
    score = 0

    if hours_left < 4:
        score += 3
    elif hours_left < 8:
        score += 2
    else:
        score += 1

    if meals > 100:
        score += 3
    elif meals > 50:
        score += 2
    else:
        score += 1

    if distance < 5:
        score += 3
    elif distance < 15:
        score += 2
    else:
        score += 1

    if score >= 7:
        return "HIGH PRIORITY - Distribute immediately"
    elif score >= 5:
        return "MEDIUM PRIORITY - Schedule soon"
    else:
        return "LOW PRIORITY - Can wait"

iface = gr.Interface(
    fn=predict,
    inputs=["number", "number", "number"],
    outputs="text"
)

iface.launch()