Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -91,10 +91,11 @@ def extract_features_from_file(file):
|
|
91 |
content = file.read().decode("utf-8").strip()
|
92 |
values = [float(x) for x in content.replace(",", " ").split()]
|
93 |
if len(values) != 30:
|
94 |
-
|
95 |
-
return
|
96 |
except Exception as e:
|
97 |
-
|
|
|
98 |
|
99 |
# --- UI with Gradio ---
|
100 |
with gr.Blocks() as demo:
|
|
|
91 |
content = file.read().decode("utf-8").strip()
|
92 |
values = [float(x) for x in content.replace(",", " ").split()]
|
93 |
if len(values) != 30:
|
94 |
+
raise ValueError("Expected 30 values, got {}".format(len(values)))
|
95 |
+
return values # must return a list of 30 floats
|
96 |
except Exception as e:
|
97 |
+
print(f"Error reading file: {e}")
|
98 |
+
return [None] * 30 # return empty values for safety
|
99 |
|
100 |
# --- UI with Gradio ---
|
101 |
with gr.Blocks() as demo:
|