Spaces:
Sleeping
Sleeping
Yurii Paniv
commited on
Commit
·
5010b53
1
Parent(s):
a459516
Add logging
Browse files
app.py
CHANGED
@@ -26,6 +26,8 @@ def check_thread(logging_queue: Queue):
|
|
26 |
dataset_name=getenv("OUTPUT_DATASET"),
|
27 |
private=True,
|
28 |
)
|
|
|
|
|
29 |
while True:
|
30 |
sleep(60)
|
31 |
batch = []
|
@@ -48,8 +50,6 @@ if getenv("HF_API_TOKEN") is not None:
|
|
48 |
log_queue = Queue()
|
49 |
t = Thread(target=check_thread, args=(log_queue,))
|
50 |
t.start()
|
51 |
-
print("Logging thread started.")
|
52 |
-
print(f"Logging to '{getenv('OUTPUT_DATASET')}'")
|
53 |
else:
|
54 |
print("No HF_API_TOKEN found. Logging is disabled.")
|
55 |
|
@@ -72,6 +72,7 @@ model = PeftModel.from_pretrained(model, "lang-uk/dragoman").to("cuda")
|
|
72 |
tokenizer = AutoTokenizer.from_pretrained(
|
73 |
"mistralai/Mistral-7B-v0.1", use_fast=False, add_bos_token=False
|
74 |
)
|
|
|
75 |
|
76 |
|
77 |
@spaces.GPU(duration=30)
|
|
|
26 |
dataset_name=getenv("OUTPUT_DATASET"),
|
27 |
private=True,
|
28 |
)
|
29 |
+
print("Logging thread started.")
|
30 |
+
print(f"Logging to '{getenv('OUTPUT_DATASET')}'")
|
31 |
while True:
|
32 |
sleep(60)
|
33 |
batch = []
|
|
|
50 |
log_queue = Queue()
|
51 |
t = Thread(target=check_thread, args=(log_queue,))
|
52 |
t.start()
|
|
|
|
|
53 |
else:
|
54 |
print("No HF_API_TOKEN found. Logging is disabled.")
|
55 |
|
|
|
72 |
tokenizer = AutoTokenizer.from_pretrained(
|
73 |
"mistralai/Mistral-7B-v0.1", use_fast=False, add_bos_token=False
|
74 |
)
|
75 |
+
tokenizer.pad_token_id = tokenizer.eos_token_id
|
76 |
|
77 |
|
78 |
@spaces.GPU(duration=30)
|