durrani commited on
Commit
6a32c67
·
1 Parent(s): 40dee47
Files changed (1) hide show
  1. app.py +14 -1
app.py CHANGED
@@ -1,4 +1,17 @@
1
-
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  # Input data
3
  x1 = torch.tensor([50, 60, 70, 80, 90])
4
  x2 = torch.tensor([20, 21, 22, 23, 24])
 
1
+ import numpy as np
2
+ import gradio as gr
3
+ import torch
4
+ #function to predict the input hours
5
+ def predict_score(hours):
6
+ #hours = np.array(hours)
7
+ pred_score = -0.5738734424645411 + 2.1659122905141825*hours
8
+ return pred_score #np.round(pred_score[0], 2)
9
+ input = gr.inputs.x1(label='Number New Students')
10
+ input = gr.inputs.x2(label='Number New Temperature')
11
+ output = gr.outputs.Textbox(label='Predicted Score')
12
+ gr.Interface( fn=predict_score,
13
+ inputs=input,
14
+ outputs=output).launch();
15
  # Input data
16
  x1 = torch.tensor([50, 60, 70, 80, 90])
17
  x2 = torch.tensor([20, 21, 22, 23, 24])