Donlapark commited on
Commit
5682f95
·
verified ·
1 Parent(s): a0ae984

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -15,7 +15,12 @@ def predict(brand, screen_size, resolution_width, resolution_height):
15
  resolution_height = int(resolution_height)
16
 
17
  # Prepare the input array for prediction
18
- input_data = np.array([[brand, screen_size, resolution_width, resolution_height]])
 
 
 
 
 
19
 
20
  # Perform the prediction
21
  prediction = model.predict(input_data)
@@ -26,7 +31,7 @@ def predict(brand, screen_size, resolution_width, resolution_height):
26
  interface = gr.Interface(
27
  fn=predict,
28
  inputs=[
29
- gr.Dropdown(choices=brand_values, label="Brand"),
30
  gr.Textbox(label="Screen Size"),
31
  gr.Textbox(label="Resolution (Width)"),
32
  gr.Textbox(label="Resolution (Height)")
 
15
  resolution_height = int(resolution_height)
16
 
17
  # Prepare the input array for prediction
18
+ input_data = pd.DataFrame({
19
+ 'Brand': [brand],
20
+ 'Screen Size': [screen_size],
21
+ 'Resolution (Width)': [resolution_width],
22
+ 'Resolution (Height)': [resolution_height]
23
+ })
24
 
25
  # Perform the prediction
26
  prediction = model.predict(input_data)
 
31
  interface = gr.Interface(
32
  fn=predict,
33
  inputs=[
34
+ gr.Dropdown(choices=list(brand_values), label="Brand"),
35
  gr.Textbox(label="Screen Size"),
36
  gr.Textbox(label="Resolution (Width)"),
37
  gr.Textbox(label="Resolution (Height)")