made1570 commited on
Commit
c0dceab
·
verified ·
1 Parent(s): 0f22707

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -46,9 +46,9 @@ def generate_text(user_input):
46
  # Decode the model output and return the result
47
  decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
48
 
49
- if "model:" in decoded_output.lower():
50
- parts = decoded_output.split("model:", 1)
51
- return parts[1].strip() # Only return the model's reply
52
 
53
  # Fallback: return full decoded output if structure is unexpected
54
  return decoded_output
 
46
  # Decode the model output and return the result
47
  decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
48
 
49
+ index = decoded_output.lower().find("model")
50
+ if index != -1:
51
+ return decoded_output[index + len("model"):].strip()
52
 
53
  # Fallback: return full decoded output if structure is unexpected
54
  return decoded_output