Update app.py
Browse files
app.py
CHANGED
|
@@ -1,14 +1,14 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
# --- Load
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
|
| 13 |
# Search the manual for any words the user typed
|
| 14 |
found = []
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
+
# --- Load multiple manuals ---
|
| 4 |
+
manuals = {}
|
| 5 |
+
|
| 6 |
+
for filename in ["sierra.txt", "sierra engine.txt"]:
|
| 7 |
+
try:
|
| 8 |
+
with open(filename, "r", encoding="utf-8") as f:
|
| 9 |
+
manuals[filename] = f.read().lower()
|
| 10 |
+
except FileNotFoundError:
|
| 11 |
+
manuals[filename] = ""
|
| 12 |
|
| 13 |
# Search the manual for any words the user typed
|
| 14 |
found = []
|