Staticaliza commited on
Commit
a5af31f
1 Parent(s): 3404bde

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -34,10 +34,10 @@ def predict(access_key, token, image, instructions, pre_input, input, seed = 42)
34
  print(">>> MODEL FAILED: Input: " + input + ", Attempted Key: " + access_key)
35
  return ("[UNAUTHORIZED ACCESS]", input, []);
36
 
37
- if len(instructions.strip()) <= 0:
38
  instructions = default_instructions
39
 
40
- if len(pre_input.strip()) <= 0:
41
  pre_input = default_pre_text
42
 
43
  formatted_input = instructions.replace(symbol, pre_input) + pre_input + input + "![](https://statical-stc-itt.hf.space/file=" + image + ")<end_of_utterance>\nAssistant:"
 
34
  print(">>> MODEL FAILED: Input: " + input + ", Attempted Key: " + access_key)
35
  return ("[UNAUTHORIZED ACCESS]", input, []);
36
 
37
+ if not instructions or len(instructions.strip()) <= 0:
38
  instructions = default_instructions
39
 
40
+ if not pre_input or len(pre_input.strip()) <= 0:
41
  pre_input = default_pre_text
42
 
43
  formatted_input = instructions.replace(symbol, pre_input) + pre_input + input + "![](https://statical-stc-itt.hf.space/file=" + image + ")<end_of_utterance>\nAssistant:"