FrederickSundeep commited on
Commit
537fc7c
·
1 Parent(s): 716c06e

update file 026

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -83,7 +83,13 @@ def generate_ticket():
83
  issue=issue
84
  )
85
 
86
- result = generator(prompt, max_length=200, do_sample=True)[0]["generated_text"]
 
 
 
 
 
 
87
 
88
  session_id = str(uuid.uuid4())
89
  timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
 
83
  issue=issue
84
  )
85
 
86
+ raw = generator(prompt, max_length=200, do_sample=True)[0]["generated_text"]
87
+
88
+ # Strip the prompt itself, leaving only the new content
89
+ if raw.startswith(prompt):
90
+ result = raw[len(prompt):].strip()
91
+ else:
92
+ result = raw.strip()
93
 
94
  session_id = str(uuid.uuid4())
95
  timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")