Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ headers = {"Authorization": f"Bearer {os.getenv('HF_TOKEN', '').strip()}"}
|
|
| 14 |
FILES = [f"Main{i}.txt" for i in range(1, 7)]
|
| 15 |
CHUNK_SIZE = 500
|
| 16 |
|
| 17 |
-
# Load and process
|
| 18 |
def process_text_files(file_list, chunk_size=CHUNK_SIZE):
|
| 19 |
combined_chunks = []
|
| 20 |
for file in file_list:
|
|
@@ -42,7 +42,7 @@ def embed_texts(text_list):
|
|
| 42 |
output = model(**encoded)
|
| 43 |
return output.last_hidden_state.mean(dim=1).numpy()
|
| 44 |
|
| 45 |
-
chunks =
|
| 46 |
if not chunks:
|
| 47 |
raise ValueError("⚠️ Keine Textausschnitte gefunden! Überprüfe die .tex-Dateien.")
|
| 48 |
|
|
|
|
| 14 |
FILES = [f"Main{i}.txt" for i in range(1, 7)]
|
| 15 |
CHUNK_SIZE = 500
|
| 16 |
|
| 17 |
+
# Load and process files
|
| 18 |
def process_text_files(file_list, chunk_size=CHUNK_SIZE):
|
| 19 |
combined_chunks = []
|
| 20 |
for file in file_list:
|
|
|
|
| 42 |
output = model(**encoded)
|
| 43 |
return output.last_hidden_state.mean(dim=1).numpy()
|
| 44 |
|
| 45 |
+
chunks = process_text_files(FILES)
|
| 46 |
if not chunks:
|
| 47 |
raise ValueError("⚠️ Keine Textausschnitte gefunden! Überprüfe die .tex-Dateien.")
|
| 48 |
|