Spaces:
Runtime error
Runtime error
project-baize
commited on
Commit
•
acaa3ab
1
Parent(s):
238ac1d
Update app.py
Browse files
app.py
CHANGED
@@ -33,6 +33,7 @@ def predict(text,
|
|
33 |
except:
|
34 |
yield [[text,"No Model Found"]],[],"No Model Found"
|
35 |
return
|
|
|
36 |
inputs = generate_prompt_with_history(text,history,tokenizer,max_length=max_context_length_tokens)
|
37 |
if inputs is False:
|
38 |
yield chatbot+[[text,"Sorry, the input is too long."]],history,"Generate Fail"
|
|
|
33 |
except:
|
34 |
yield [[text,"No Model Found"]],[],"No Model Found"
|
35 |
return
|
36 |
+
torch.cuda.empty_cache()
|
37 |
inputs = generate_prompt_with_history(text,history,tokenizer,max_length=max_context_length_tokens)
|
38 |
if inputs is False:
|
39 |
yield chatbot+[[text,"Sorry, the input is too long."]],history,"Generate Fail"
|