File size: 654 Bytes
ce1ba54
25288f7
9e6875e
 
25288f7
9e6875e
 
 
 
 
 
 
 
 
 
 
25288f7
 
 
 
 
 
 
ce1ba54
 
9e6875e
ce1ba54
 
9e6875e
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
import gradio as gr
import joblib
import requests
import os

# Download the model file
model_url = "https://huggingface.co/stummala521/AI4SAR/resolve/main/model.pkl"
local_filename = "model.pkl"

# Download the file
response = requests.get(model_url, allow_redirects=True)
with open(local_filename, 'wb') as f:
    f.write(response.content)

# Load the model
model = joblib.load(local_filename)

test_data = {
    "location_found_elevation": 1500,
    "situation": "lost"
}

output = model.predict([test_data])

def greet(name):
    return "Hello " + name + "!" + str(output[0])

demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch()