ZainFaisal commited on
Commit
1118c03
·
verified ·
1 Parent(s): af2d7cb

Upload 3 files

Browse files
Files changed (3) hide show
  1. app.py +21 -0
  2. model/model.pkl +3 -0
  3. requirements.txt +2 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import pickle
3
+
4
+ # Load your model
5
+ with open("model/model.pkl", "rb") as f:
6
+ model = pickle.load(f)
7
+
8
+ # Define prediction function
9
+ def predict(input_text):
10
+ return model.predict([input_text])[0]
11
+
12
+ # Create Gradio Interface
13
+ interface = gr.Interface(
14
+ fn=predict,
15
+ inputs="text",
16
+ outputs="text",
17
+ title="ML Model Deployment"
18
+ )
19
+
20
+ if __name__ == "__main__":
21
+ interface.launch()
model/model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2fd44755b439aa2f6a33b641f4db91d8b112152c32da4e329512fb440af5e6ff
3
+ size 2533
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ gradio
2
+ scikit-learn