andromeda01111 commited on
Commit
a19ae09
Β·
verified Β·
1 Parent(s): 43dfbe8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -148,8 +148,8 @@ with gr.Blocks() as demo:
148
  # Check if we have exactly 30 features
149
  if len(values) != 30:
150
  return "❌ The file must contain exactly 30 numerical values."
151
-
152
- return {feature_inputs[i]: values[i] for i in range(30)}
153
 
154
  except Exception as e:
155
  return f"❌ Error processing file: {e}"
@@ -167,7 +167,7 @@ with gr.Blocks() as demo:
167
  model_selector.change(toggle_inputs, model_selector, [image_input, *feature_inputs, file_input])
168
 
169
  # Process uploaded file and populate feature fields
170
- file_input.change(extract_features_from_file, file_input, feature_inputs)
171
 
172
 
173
  # Toggle input fields based on model selection
 
148
  # Check if we have exactly 30 features
149
  if len(values) != 30:
150
  return "❌ The file must contain exactly 30 numerical values."
151
+ return values
152
+ # return {feature_inputs[i]: values[i] for i in range(30)}
153
 
154
  except Exception as e:
155
  return f"❌ Error processing file: {e}"
 
167
  model_selector.change(toggle_inputs, model_selector, [image_input, *feature_inputs, file_input])
168
 
169
  # Process uploaded file and populate feature fields
170
+ file_input.change(extract_features_from_file, inputs=file_input, outputs=feature_inputs)
171
 
172
 
173
  # Toggle input fields based on model selection