Update app.py
This commit is contained in:
parent
db8c43fa76
commit
95b9be1079
2
app.py
2
app.py
|
@ -47,6 +47,8 @@ def predict(text,
|
||||||
global total_count
|
global total_count
|
||||||
total_count += 1
|
total_count += 1
|
||||||
print(total_count)
|
print(total_count)
|
||||||
|
if total_count % 50 == 0 :
|
||||||
|
os.system("nvidia-smi")
|
||||||
with torch.no_grad():
|
with torch.no_grad():
|
||||||
for x in greedy_search(input_ids,model,tokenizer,stop_words=["[|Human|]", "[|AI|]"],max_length=max_length_tokens,temperature=temperature,top_p=top_p):
|
for x in greedy_search(input_ids,model,tokenizer,stop_words=["[|Human|]", "[|AI|]"],max_length=max_length_tokens,temperature=temperature,top_p=top_p):
|
||||||
if is_stop_word_or_prefix(x,["[|Human|]", "[|AI|]"]) is False:
|
if is_stop_word_or_prefix(x,["[|Human|]", "[|AI|]"]) is False:
|
||||||
|
|
Loading…
Reference in New Issue