gracialy commited on
Commit
32daf8f
·
1 Parent(s): d38d1f8

Initial commit

Browse files
Files changed (3) hide show
  1. app.py +28 -0
  2. model.joblib +3 -0
  3. requirements.txt +4 -0
app.py ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import joblib
2
+ import gradio as gr
3
+ import numpy as np
4
+
5
+ # Load the model
6
+ model = joblib.load("model.joblib")
7
+
8
+ # Define prediction function
9
+ def predict(input1, input2, input3): # adjust based on your features
10
+ X = np.array([[input1, input2, input3]])
11
+ prediction = model.predict(X)
12
+ return prediction[0]
13
+
14
+ # Create Gradio interface
15
+ demo = gr.Interface(
16
+ fn=predict,
17
+ inputs=[
18
+ gr.Number(label="Feature 1"),
19
+ gr.Number(label="Feature 2"),
20
+ gr.Number(label="Feature 3")
21
+ ],
22
+ outputs="text",
23
+ title="My Sklearn Model"
24
+ )
25
+
26
+ # Run Gradio app
27
+ if __name__ == "__main__":
28
+ demo.launch()
model.joblib ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8e9c3d63e145ca426814b275b7d3f5f60169e0992b3044dcef2b7a3f892333fd
3
+ size 534162
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ scikit-learn
2
+ gradio
3
+ joblib
4
+ numpy