Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -44,11 +44,7 @@ def predict(text,
|
|
| 44 |
begin_length = len(prompt)
|
| 45 |
input_ids = inputs["input_ids"][:,-max_context_length_tokens:].to(device)
|
| 46 |
torch.cuda.empty_cache()
|
| 47 |
-
|
| 48 |
-
total_count += 1
|
| 49 |
-
print(total_count)
|
| 50 |
-
if total_count % 50 == 0 :
|
| 51 |
-
os.system("nvidia-smi")
|
| 52 |
with torch.no_grad():
|
| 53 |
for x in greedy_search(input_ids,model,tokenizer,stop_words=["[|Human|]", "[|AI|]"],max_length=max_length_tokens,temperature=temperature,top_p=top_p):
|
| 54 |
if is_stop_word_or_prefix(x,["[|Human|]", "[|AI|]"]) is False:
|
|
|
|
| 44 |
begin_length = len(prompt)
|
| 45 |
input_ids = inputs["input_ids"][:,-max_context_length_tokens:].to(device)
|
| 46 |
torch.cuda.empty_cache()
|
| 47 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
with torch.no_grad():
|
| 49 |
for x in greedy_search(input_ids,model,tokenizer,stop_words=["[|Human|]", "[|AI|]"],max_length=max_length_tokens,temperature=temperature,top_p=top_p):
|
| 50 |
if is_stop_word_or_prefix(x,["[|Human|]", "[|AI|]"]) is False:
|