Piux24 commited on
Commit
088e658
·
verified ·
1 Parent(s): 7f8844d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -1,5 +1,8 @@
1
  def chat_response(message):
2
  if "syllabus" in message.lower():
3
- return syllabus_text[:1000] # Syllabus ka first 1000 characters return karega
 
 
 
4
  response = chatbot(message, max_length=100, do_sample=True)
5
  return response[0]['generated_text']
 
1
  def chat_response(message):
2
  if "syllabus" in message.lower():
3
+ chunk_size = 500 # Ek baar me 500 characters
4
+ chunks = [syllabus_text[i:i+chunk_size] for i in range(0, len(syllabus_text), chunk_size)]
5
+ return "\n\n".join(chunks[:3]) # Sirf pehle 3 chunks dikhayega (1500 characters)
6
+
7
  response = chatbot(message, max_length=100, do_sample=True)
8
  return response[0]['generated_text']