Spaces:
Runtime error
Runtime error
project-baize
commited on
Commit
•
8ed0878
1
Parent(s):
1a2243e
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,10 @@ def predict(text,
|
|
27 |
max_context_length_tokens,):
|
28 |
if text=="":
|
29 |
return history,history,"Empty Context"
|
30 |
-
|
|
|
|
|
|
|
31 |
inputs = generate_prompt_with_history(text,history,tokenizer,max_length=max_context_length_tokens)
|
32 |
if inputs is False:
|
33 |
return [[x[0],convert_to_markdown(x[1])] for x in history]+[[text,"Sorry, the input is too long."]],history,"Generate Fail"
|
|
|
27 |
max_context_length_tokens,):
|
28 |
if text=="":
|
29 |
return history,history,"Empty Context"
|
30 |
+
try:
|
31 |
+
model
|
32 |
+
except:
|
33 |
+
return [[text,"No Model Found"]],[],"No Model Found"
|
34 |
inputs = generate_prompt_with_history(text,history,tokenizer,max_length=max_context_length_tokens)
|
35 |
if inputs is False:
|
36 |
return [[x[0],convert_to_markdown(x[1])] for x in history]+[[text,"Sorry, the input is too long."]],history,"Generate Fail"
|