Spaces:
Running
Running
update latency
Browse files
app.py
CHANGED
|
@@ -122,19 +122,12 @@ with tab_try:
|
|
| 122 |
)
|
| 123 |
|
| 124 |
if user_query.strip():
|
| 125 |
-
t0 = time.perf_counter()
|
| 126 |
result = norm.normalize(user_query.strip())
|
| 127 |
-
elapsed_ms = (time.perf_counter() - t0) * 1000
|
| 128 |
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
else:
|
| 134 |
-
st.info(f"**`{user_query.strip()}`** → **`{result}`**")
|
| 135 |
-
|
| 136 |
-
with meta_col:
|
| 137 |
-
st.metric("Latency", f"{elapsed_ms:.2f} ms")
|
| 138 |
|
| 139 |
# Check if it's in the benchmark dataset
|
| 140 |
match = df[df["noisy"].str.lower() == user_query.strip().lower()]
|
|
|
|
| 122 |
)
|
| 123 |
|
| 124 |
if user_query.strip():
|
|
|
|
| 125 |
result = norm.normalize(user_query.strip())
|
|
|
|
| 126 |
|
| 127 |
+
if result.lower() == user_query.strip().lower():
|
| 128 |
+
st.success(f"**`{user_query.strip()}`** → no change needed → **`{result}`**")
|
| 129 |
+
else:
|
| 130 |
+
st.info(f"**`{user_query.strip()}`** → **`{result}`**")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
| 132 |
# Check if it's in the benchmark dataset
|
| 133 |
match = df[df["noisy"].str.lower() == user_query.strip().lower()]
|