mod allegro
This commit is contained in:
parent
c5e4fc68c9
commit
46e2c21cfd
19
allegro.py
19
allegro.py
|
|
@ -26,15 +26,19 @@ def fetch_documents():
|
||||||
response = collection.query.fetch_objects()
|
response = collection.query.fetch_objects()
|
||||||
documents = []
|
documents = []
|
||||||
for item in response["data"]["Get"]["Document"]:
|
for item in response["data"]["Get"]["Document"]:
|
||||||
file_name = item.get("fileName", "unknown_file")
|
print(item)
|
||||||
content = item.get("content", "")
|
#file_name = item.get("fileName", "unknown_file")
|
||||||
if content:
|
#content = item.get("content", "")
|
||||||
documents.append(f"fileName: {file_name}, content: {content}")
|
#if content:
|
||||||
print(f"fileName: {file_name}")
|
# documents.append(f"fileName: {file_name}, content: {content}")
|
||||||
return documents
|
# print(f"fileName: {file_name}")
|
||||||
|
#return documents
|
||||||
|
#return documents
|
||||||
|
|
||||||
documents = fetch_documents()
|
|
||||||
|
|
||||||
|
fetch_documents()
|
||||||
|
|
||||||
|
"""
|
||||||
# 3️⃣ Inicjalizacja modelu
|
# 3️⃣ Inicjalizacja modelu
|
||||||
model_name = "allegro/multislav-5lang"
|
model_name = "allegro/multislav-5lang"
|
||||||
device = "cuda" if torch.cuda.is_available() else "cpu"
|
device = "cuda" if torch.cuda.is_available() else "cpu"
|
||||||
|
|
@ -99,3 +103,4 @@ model.save_pretrained("./models/allegro")
|
||||||
tokenizer.save_pretrained("./models/allegro")
|
tokenizer.save_pretrained("./models/allegro")
|
||||||
|
|
||||||
print("✅ Model został wytrenowany i zapisany!")
|
print("✅ Model został wytrenowany i zapisany!")
|
||||||
|
"""
|
||||||
Loading…
Reference in New Issue