import gradio as gr import joblib import requests import os import pandas as pd # 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 = pd.DataFrame({'location_found_elevation': [700, 500, 300], 'situation': ['Lost', 'Stranded', '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()