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

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -45,6 +45,12 @@ def generate_text(user_input):
45
 
46
  # Decode the model output and return the result
47
  decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
 
 
 
 
 
 
48
  return decoded_output
49
 
50
  # Build the Gradio interface
 
45
 
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
55
 
56
  # Build the Gradio interface